dash crashes when checking syntax of a script consisting of a very long
sequence of backticks:
$ printf %09999d | tr 0 '`' | dash -n
Segmentation fault
Valgrind says it's a stack overflow:
Process terminating with default action of signal 11 (SIGSEGV)
Access not within mapped region at address 0xFE33B4C8
Stack overflow in thread #1: can't grow stack to 0xfe33b000
at 0x1180EA: UnknownInlinedFun (string_fortified.h:34)
by 0x1180EA: readtoken1 (parser.c:1377)
Found using American Fuzzy Lop:
http://lcamtuf.coredump.cx/afl/
Valgrind is right. I don't think you're likely to run into this on non-pathological input, but it's a relatively simple fix. Patch posted to dash@, archived at forwarded-to. наб
Fixed this series (v3 in forwarded-to thread): https://git.kernel.org/pub/scm/utils/dash/dash.git/commit/?id=d89761b0e1652e212e9354fd3c96f977de873a06 https://git.kernel.org/pub/scm/utils/dash/dash.git/commit/?id=f96ec8765cf37eb0c222a563de2f767ebfbf56db наб