From: Rich Felker Date: Wed, 18 Apr 2012 02:41:38 +0000 (-0400) Subject: fix over-read in %ls with non-wide scanf X-Git-Tag: v0.8.8~4 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2dd5dc78d4502381e2933137ed525acf339cb383;p=oweals%2Fmusl.git fix over-read in %ls with non-wide scanf --- diff --git a/src/stdio/vfscanf.c b/src/stdio/vfscanf.c index 8be0d91c..73294cdb 100644 --- a/src/stdio/vfscanf.c +++ b/src/stdio/vfscanf.c @@ -312,6 +312,7 @@ int vfscanf(FILE *f, const char *fmt, va_list ap) if (readwc(c, &wcs, &st) < 0) goto input_fail; } + shunget(f); if (!mbsinit(&st)) goto input_fail; if (dest) *wcs++ = 0; break;