about summary refs log tree commit diff
path: root/src/stdio/vfscanf.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-04-17 22:41:38 -0400
committerRich Felker <dalias@aerifal.cx>2012-04-17 22:41:38 -0400
commit2dd5dc78d4502381e2933137ed525acf339cb383 (patch)
tree73f38e8c1ded96447699af1757e3b81072d2cfca /src/stdio/vfscanf.c
parent9ab180fa57f3a01b2004c3d19ad8dc3732f6069d (diff)
downloadmusl-2dd5dc78d4502381e2933137ed525acf339cb383.tar.gz
musl-2dd5dc78d4502381e2933137ed525acf339cb383.tar.xz
musl-2dd5dc78d4502381e2933137ed525acf339cb383.zip
fix over-read in %ls with non-wide scanf
Diffstat (limited to 'src/stdio/vfscanf.c')
-rw-r--r--src/stdio/vfscanf.c1
1 files changed, 1 insertions, 0 deletions
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;