diff --git a/src/misc/wordexp.c b/src/misc/wordexp.c index 4a3efc7bc40a83d055bb1f4d952e6b70b2d4893c..34fc900ac73e3ea928f111ecc098f1b15036eed2 100644 --- a/src/misc/wordexp.c +++ b/src/misc/wordexp.c @@ -82,6 +82,8 @@ static int do_wordexp(const char *s, wordexp_t *we, int flags) if (we->we_offs > SIZE_MAX/sizeof(void *)/4) return WRDE_NOSPACE; i += we->we_offs; + } else { + we->we_offs = 0; } if (pipe(p) < 0) return WRDE_NOSPACE;