From 489247a0008e0162d51aad1af30dce14975c980c Mon Sep 17 00:00:00 2001 From: yi chen <94xhn1@gmail.com> Date: Sun, 19 Jul 2026 03:23:29 +0800 Subject: [PATCH] Fix out-of-bounds cursor increment in pop_token() Signed-off-by: yi chen <94xhn1@gmail.com> --- src/conf.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/conf.c b/src/conf.c index d38a801..4f4ff55 100644 --- a/src/conf.c +++ b/src/conf.c @@ -89,8 +89,12 @@ static char *pop_token(char **line) return NULL; } - *end = 0; /* Terminate token. */ - *line = end + 1; + if (*end == '\0') { + *line = NULL; + } else { + *end = 0; /* Terminate token. */ + *line = end + 1; + } return token; }