X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fstdio%2Fopen_memstream.c;fp=src%2Fstdio%2Fopen_memstream.c;h=5773709866d2166fb8b8db42fa311ae4e532d5c6;hp=2f3569f1d177211962558b8810837e0229ff7eea;hb=32d67e938e8da0f37c59247acee8b10eaf9a113c;hpb=d4fa6f0e08ff5a292d2aeeeeda80670a1a082cae diff --git a/src/stdio/open_memstream.c b/src/stdio/open_memstream.c index 2f3569f1..57737098 100644 --- a/src/stdio/open_memstream.c +++ b/src/stdio/open_memstream.c @@ -28,7 +28,7 @@ static off_t ms_seek(FILE *f, off_t off, int whence) errno = EINVAL; return -1; } - if (-off > base || off > SSIZE_MAX-base) goto fail; + if (off < -base || off > SSIZE_MAX-base) goto fail; return c->pos = base+off; }