mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
fmttoken() needs a minimal char[4] token buffer passed to it. Originally reported by: Jakub Wilk <jwilk@jwilk.net> Original bug report: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=879464 The following code lines from fmttoken() yield a n=3 for SYMSEMI as n=1 from the start, e.g. 'for <>;'. case SYMSEMI: if(tok[0]=='<') tok[n++] = '>'; sym = ';'; break; default: sym = 0; } tok[n++] = sym; } tok[n] = 0; n[0]='<' n[1]='>' n[2]=';' n[3]=0 # <-- BUFFER overflow as the passed character buffers have a size of 3 src/cmd/ksh93/sh/lex.c: - DBUG: sh_lex(): Adjust char tokstr[3] to char tokstr[4] - sh_syntax(): Adjust char tokbuf[3] to char tokbuf[4] |
||
---|---|---|
.. | ||
builtin | ||
INIT | ||
ksh93 | ||
Mamfile |