From 19c7587f28a8b3de2ad161020d4673c674af343b Mon Sep 17 00:00:00 2001 From: "Chloe M." Date: Sat, 23 May 2026 14:36:20 +0000 Subject: core: tokbuf: Fix buffer overflow Signed-off-by: Chloe M. --- core/tokbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- cgit v1.2.3