projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
fix twos complement overflow bug in mem streams boundary check
[musl]
/
src
/
stdio
/
open_wmemstream.c
diff --git
a/src/stdio/open_wmemstream.c
b/src/stdio/open_wmemstream.c
index
3bc0f25
..
41b92d2
100644
(file)
--- a/
src/stdio/open_wmemstream.c
+++ b/
src/stdio/open_wmemstream.c
@@
-29,7
+29,7
@@
static off_t wms_seek(FILE *f, off_t off, int whence)
errno = EINVAL;
return -1;
}
- if (
-off >
base || off > SSIZE_MAX/4-base) goto fail;
+ if (
off < -
base || off > SSIZE_MAX/4-base) goto fail;
memset(&c->mbs, 0, sizeof c->mbs);
return c->pos = base+off;
}