commit f193439e8c4a60a961c4f5fcc9c4475da0b80201 from: Stefan Sperling date: Mon Aug 19 15:09:20 2024 UTC fix a segfault triggered via the ! shell escape As reported by Tom, the following input sequence would lead to a segfault: !? Resetting the cursor position in makeargv's special-case handling of shell escapes fixes this. tested by myself and Tom ok Tom commit - fd4494f6c62ce7eaa7cea7fa32df287ee211d49b commit + f193439e8c4a60a961c4f5fcc9c4475da0b80201 blob - c1f12841615d06ed7a8cef2569d476ea0fe7c5c8 blob + d1a99c8fd75a38cab32267dd7b9b8dfd969ec858 --- makeargv.c +++ makeargv.c @@ -59,6 +59,8 @@ makeargv(void) *argp++ = "!"; /* No room in string to get this */ margc++; cp++; + cursor_argc = 0; + cursor_argo = 0; } while ((c = *cp)) { int inquote = 0;