projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
fix integer overflow in WIFSTOPPED macro
[musl]
/
src
/
stdio
/
vfscanf.c
diff --git
a/src/stdio/vfscanf.c
b/src/stdio/vfscanf.c
index
9e030fc
..
b78a374
100644
(file)
--- a/
src/stdio/vfscanf.c
+++ b/
src/stdio/vfscanf.c
@@
-57,7
+57,7
@@
int vfscanf(FILE *restrict f, const char *restrict fmt, va_list ap)
{
int width;
int size;
- int alloc;
+ int alloc
= 0
;
int base;
const unsigned char *p;
int c, t;
@@
-76,6
+76,9
@@
int vfscanf(FILE *restrict f, const char *restrict fmt, va_list ap)
FLOCK(f);
+ if (!f->rpos) __toread(f);
+ if (!f->rpos) goto input_fail;
+
for (p=(const unsigned char *)fmt; *p; p++) {
alloc = 0;