From: Marcus Boerger Date: Sat, 18 Mar 2006 19:56:35 +0000 (+0000) Subject: - Fix seek/eof issue in temp streams X-Git-Tag: RELEASE_1_3~380 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=46bc026fb02d201d0909257e6deacb576579ad81;p=php - Fix seek/eof issue in temp streams --- diff --git a/main/streams/memory.c b/main/streams/memory.c index 5de3ba2bab..1953d71e25 100644 --- a/main/streams/memory.c +++ b/main/streams/memory.c @@ -159,7 +159,7 @@ static int php_stream_memory_seek(php_stream *stream, off_t offset, int whence, return 0; } } else { - if (ms->fpos < (size_t)(offset)) { + if (ms->fpos + (size_t)(offset) > ms->fsize) { ms->fpos = ms->fsize; *newoffs = -1; return -1;