Skip to content

Commit a9fcf49

Browse files
committed
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Revert "Fix GH-15980: Signed integer overflow in main/streams/streams.c"
2 parents c701508 + ee95ee7 commit a9fcf49

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
@@ -23,8 +23,6 @@ PHP NEWS
2323
- Streams:
2424
. Fixed bugs GH-15908 and GH-15026 (leak / assertion failure in streams.c).
2525
(nielsdos)
26-
. Fixed bug GH-15980 (Signed integer overflow in main/streams/streams.c).
27-
(cmb)
2826

2927
- TSRM:
3028
. 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
@@ -1382,13 +1382,8 @@ PHPAPI int _php_stream_seek(php_stream *stream, zend_off_t offset, int whence)
13821382

13831383
switch(whence) {
13841384
case SEEK_CUR:
1385-
ZEND_ASSERT(stream->position >= 0);
1386-
if (UNEXPECTED(offset > ZEND_LONG_MAX - stream->position)) {
1387-
offset = ZEND_LONG_MAX;
1388-
} else {
1389-
offset = stream->position + offset;
1390-
}
1391-
whence = SEEK_SET;
1385+
offset = stream->position + offset;
1386+
whence = SEEK_SET;
13921387
break;
13931388
}
13941389
ret = stream->ops->seek(stream, offset, whence, &stream->position);

0 commit comments

Comments
 (0)