From 8c8e100e0146c9a6384daf5436b892410a71ad01 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sat, 16 May 2026 18:21:02 +0200 Subject: [PATCH] Fix potential buffer overflow in strsplit --- cmdline/support.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmdline/support.c b/cmdline/support.c index 5936c048..d6bc0dc8 100644 --- a/cmdline/support.c +++ b/cmdline/support.c @@ -886,7 +886,7 @@ unsigned strsplit(char** split_map, unsigned split_max, char* str, const char* d /* skip initial delimiters */ str += strspn(str, delimiters); - while (*str != 0 || mac == split_max) { + while (*str != 0 && mac < split_max) { /* start of the token */ split_map[mac] = str; ++mac;