~ chicken-core (master) 500c6f187c43c54bf0208402e5108423afa1c8a4
commit 500c6f187c43c54bf0208402e5108423afa1c8a4
Author: felix <felix@call-with-current-continuation.org>
AuthorDate: Tue Sep 1 14:14:14 2026 +0200
Commit: felix <felix@call-with-current-continuation.org>
CommitDate: Tue Sep 1 14:14:14 2026 +0200
avoid buffer overflow when parsing command line
Report and fix by "crzcrz"
diff --git a/runtime.c b/runtime.c
index b4d692f7..9b00277f 100644
--- a/runtime.c
+++ b/runtime.c
@@ -651,6 +651,7 @@ void parse_argv(C_char *cmds)
while(*ptr != '\0') {
if(*ptr == delim || (C_utf_isspace((int)(*ptr)) && !delim)) break;
if(delim && *ptr == '\\') ++ptr;
+ if(n >= STRING_BUFFER_SIZE - 1) break;
*(bptr++) = *(ptr++);
++n;
}
Trap