mirror of
git://git.musl-libc.org/musl
synced 2024-12-18 12:45:11 +00:00
fix wordexp not to read past end of string ending with lone backslash
This commit is contained in:
parent
d9bdfd1644
commit
7c84547900
@ -42,7 +42,7 @@ static int do_wordexp(const char *s, wordexp_t *we, int flags)
|
||||
|
||||
if (flags & WRDE_NOCMD) for (i=0; s[i]; i++) switch (s[i]) {
|
||||
case '\\':
|
||||
if (!sq) i++;
|
||||
if (!sq && !s[++i]) return WRDE_SYNTAX;
|
||||
break;
|
||||
case '\'':
|
||||
if (!dq) sq^=1;
|
||||
|
Loading…
Reference in New Issue
Block a user