diff options
author | Rich Felker <dalias@aerifal.cx> | 2018-12-09 22:20:15 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2018-12-09 22:20:15 -0500 |
commit | 7c8454790080395bf5b27857a766b3468aa5ed98 (patch) | |
tree | 4c671ec702507f79b3e84e4904706dcfced3804d | |
parent | d9bdfd1644320ab916ea31d95da4bf641042209a (diff) | |
download | musl-7c8454790080395bf5b27857a766b3468aa5ed98.tar.gz musl-7c8454790080395bf5b27857a766b3468aa5ed98.tar.bz2 musl-7c8454790080395bf5b27857a766b3468aa5ed98.tar.xz musl-7c8454790080395bf5b27857a766b3468aa5ed98.zip |
fix wordexp not to read past end of string ending with lone backslash
-rw-r--r-- | src/misc/wordexp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/misc/wordexp.c b/src/misc/wordexp.c index d123cf75..db83a69f 100644 --- a/src/misc/wordexp.c +++ b/src/misc/wordexp.c @@ -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; |