projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bef7a85
)
wordexp must set the we_offs entries of we_wordv to null pointers
author
Rich Felker
<dalias@aerifal.cx>
Mon, 16 Apr 2012 17:25:05 +0000
(13:25 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Mon, 16 Apr 2012 17:25:05 +0000
(13:25 -0400)
src/misc/wordexp.c
patch
|
blob
|
history
diff --git
a/src/misc/wordexp.c
b/src/misc/wordexp.c
index 34fc900ac73e3ea928f111ecc098f1b15036eed2..15adddbe381e14cb6e70b7db6f6502e84111deb6 100644
(file)
--- a/
src/misc/wordexp.c
+++ b/
src/misc/wordexp.c
@@
-139,6
+139,10
@@
static int do_wordexp(const char *s, wordexp_t *we, int flags)
we->we_wordv = wv;
we->we_wordc = i;
+
+ for (i=we->we_offs; i; i--)
+ we->we_wordv[i-1] = 0;
+
if (flags & WRDE_DOOFFS) we->we_wordc -= we->we_offs;
return err;
}