diff options
| author | Chloe M. <chloe@mirocom.org> | 2026-05-23 14:36:20 +0000 |
|---|---|---|
| committer | Chloe M. <chloe@mirocom.org> | 2026-05-23 14:36:20 +0000 |
| commit | 19c7587f28a8b3de2ad161020d4673c674af343b (patch) | |
| tree | a112bf3f1ba64176720165f41dd6b02615dc5dc4 | |
| parent | 5f726024711e0c803a50e3124820d7d4b214dd93 (diff) | |
core: tokbuf: Fix buffer overflow
Signed-off-by: Chloe M. <chloe@mirocom.org>
| -rw-r--r-- | core/tokbuf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/tokbuf.c b/core/tokbuf.c index e880c15..05e8755 100644 --- a/core/tokbuf.c +++ b/core/tokbuf.c @@ -30,7 +30,7 @@ tokbuf_push(struct tokbuf *tokbuf, struct token *tok) return -1; } - if ((tokbuf->head++) >= TOKBUF_CAP) { + if ((tokbuf->head++) >= TOKBUF_CAP - 1) { tokbuf->head = 0; } |
