提交 6250c0be 编写于 作者: R Rich Felker

wordexp cannot use we_offs unless WRDE_DOOFFS flag is set

previously, a potentially-indeterminate value from we_offs was being
used, resulting in wrong we_wordc and subsequent crashes in the
caller.
上级 febbd12d
......@@ -136,7 +136,8 @@ static int do_wordexp(const char *s, wordexp_t *we, int flags)
}
we->we_wordv = wv;
we->we_wordc = i - we->we_offs;
we->we_wordc = i;
if (flags & WRDE_DOOFFS) we->we_wordc -= we->we_offs;
return err;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册