Skip to content

Commit 90cdc4d

Browse files
committed
Fix GH-21700: _php_stream_seek() assertion triggered on negative offset.
1 parent 19f73c5 commit 90cdc4d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

main/streams/streams.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1414,7 +1414,8 @@ PHPAPI int _php_stream_seek(php_stream *stream, zend_off_t offset, int whence)
14141414
offset = stream->position + offset;
14151415
}
14161416
whence = SEEK_SET;
1417-
break;
1417+
/* fall through to reject a possible negative offset */
1418+
ZEND_FALLTHROUGH;
14181419
case SEEK_SET:
14191420
if (offset < 0) {
14201421
return -1;

0 commit comments

Comments
 (0)