projects
/
oweals
/
musl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
fix possible access to uninitialized memory in shgetc (via scanf)
[oweals/musl.git]
/
src
/
internal
/
shgetc.c
diff --git
a/src/internal/shgetc.c
b/src/internal/shgetc.c
index a4a9c633dc976033622003c3cc7e5068466076bd..7455d2f00a04e477db9f4129fb4d5ba0809af1cb 100644
(file)
--- a/
src/internal/shgetc.c
+++ b/
src/internal/shgetc.c
@@
-32,6
+32,6
@@
int __shgetc(FILE *f)
else
f->shend = f->rend;
f->shcnt = f->buf - f->rpos + cnt;
- if (f->rpos
[-1] != c
) f->rpos[-1] = c;
+ if (f->rpos
<= f->buf
) f->rpos[-1] = c;
return c;
}