X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fstdio%2Fopen_wmemstream.c;h=41b92d2152f58a402f5d4e965ab4e9cc8be841c2;hp=3bc0f25412f373c899380c037c80c87a289a1b2d;hb=32d67e938e8da0f37c59247acee8b10eaf9a113c;hpb=d4fa6f0e08ff5a292d2aeeeeda80670a1a082cae diff --git a/src/stdio/open_wmemstream.c b/src/stdio/open_wmemstream.c index 3bc0f254..41b92d21 100644 --- 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; }