Do not strip CTL* escapes from redirection filenames in argstr(); they
are later stripped with rmescapes() in expandarg(). If the filename has already been unescaped, doing it again in rmescapes() can walk off the end of the string, leading to memory corruption and eventually SIGSEGV. Noticed by: kris
This commit is contained in:
parent
ae02ceb621
commit
c121fd80b8
@ -213,7 +213,7 @@ STATIC void
|
||||
argstr(char *p, int flag)
|
||||
{
|
||||
char c;
|
||||
int quotes = flag & (EXP_FULL | EXP_CASE); /* do CTLESC */
|
||||
int quotes = flag & (EXP_FULL | EXP_CASE | EXP_REDIR); /* do CTLESC */
|
||||
int firsteq = 1;
|
||||
|
||||
if (*p == '~' && (flag & (EXP_TILDE | EXP_VARTILDE)))
|
||||
|
Loading…
Reference in New Issue
Block a user