From b4634578ba12af7ff3bdd097d559c2e9ab24663b Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Tue, 18 Aug 2026 22:36:07 +0200 Subject: [PATCH] Fix buffer over-read in argsplit when trailing backslash occurs inside double quotes --- cmdline/str.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmdline/str.c b/cmdline/str.c index 01141c07..88ccc511 100644 --- a/cmdline/str.c +++ b/cmdline/str.c @@ -115,7 +115,7 @@ unsigned argsplit(const char** split_map, unsigned split_max, char* str) /* double-quoted block */ ++str; while (*str != 0 && *str != '"') { - if (*str == '\\' && strchr(dq_escapable, *(str + 1))) { + if (*str == '\\' && *(str + 1) != 0 && strchr(dq_escapable, *(str + 1))) { ++str; } *dst++ = *str++;