newlib: wordexp: drop dangerous fprintf
wordexp uses fprintf in a dangerous way. It uses an unchecked input string as format string, rather than as parameter to a %s. Replace fprintf with fputs. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
8bfb1afd6b
commit
5ace9004d9
|
@ -127,9 +127,9 @@ wordexp(const char *__restrict words, wordexp_t *__restrict pwordexp, int flags)
|
||||||
|
|
||||||
if (flags & WRDE_SHOWERR)
|
if (flags & WRDE_SHOWERR)
|
||||||
{
|
{
|
||||||
fprintf(stderr, tmp);
|
fputs(tmp, stderr);
|
||||||
while(fgets(tmp, MAXLINELEN, f_err))
|
while(fgets(tmp, MAXLINELEN, f_err))
|
||||||
fprintf(stderr, tmp);
|
fputs(tmp, stderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
Loading…
Reference in New Issue