Skip to content

Commit ee95ee7

Browse files
committed
Revert "Fix GH-15980: Signed integer overflow in main/streams/streams.c"
This reverts commit 6a04c79, since the new test case apparently fails on 64bit Linux, so this needs closer investigation.
1 parent 6a04c79 commit ee95ee7

File tree

3 files changed

+2
-20
lines changed

3 files changed

+2
-20
lines changed

NEWS

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ PHP NEWS
2929
- Streams:
3030
. Fixed bugs GH-15908 and GH-15026 (leak / assertion failure in streams.c).
3131
(nielsdos)
32-
. Fixed bug GH-15980 (Signed integer overflow in main/streams/streams.c).
33-
(cmb)
3432

3533
- TSRM:
3634
. Prevent closing of unrelated handles. (cmb)

ext/standard/tests/streams/gh15980.phpt

Lines changed: 0 additions & 11 deletions
This file was deleted.

main/streams/streams.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,13 +1354,8 @@ PHPAPI int _php_stream_seek(php_stream *stream, zend_off_t offset, int whence)
13541354

13551355
switch(whence) {
13561356
case SEEK_CUR:
1357-
ZEND_ASSERT(stream->position >= 0);
1358-
if (UNEXPECTED(offset > ZEND_LONG_MAX - stream->position)) {
1359-
offset = ZEND_LONG_MAX;
1360-
} else {
1361-
offset = stream->position + offset;
1362-
}
1363-
whence = SEEK_SET;
1357+
offset = stream->position + offset;
1358+
whence = SEEK_SET;
13641359
break;
13651360
}
13661361
ret = stream->ops->seek(stream, offset, whence, &stream->position);

0 commit comments

Comments
 (0)