From 2dd5dc78d4502381e2933137ed525acf339cb383 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 17 Apr 2012 22:41:38 -0400 Subject: [PATCH] fix over-read in %ls with non-wide scanf --- src/stdio/vfscanf.c | 1 + 1 file changed, 1 insertion(+) 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; -- 2.25.1