mirror of
https://github.com/php/php-src.git
synced 2024-11-29 21:04:10 +08:00
- Fix issue with LimitIterator and bounds checking
This commit is contained in:
parent
ba0b3868ee
commit
ce20de5e46
@ -1493,7 +1493,7 @@ static inline void spl_limit_it_seek(spl_dual_it_object *intern, long pos TSRMLS
|
||||
zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0 TSRMLS_CC, "Cannot seek to %ld which is below the offset %ld", pos, intern->u.limit.offset);
|
||||
return;
|
||||
}
|
||||
if (pos > intern->u.limit.offset + intern->u.limit.count && intern->u.limit.count != -1) {
|
||||
if (pos >= intern->u.limit.offset + intern->u.limit.count && intern->u.limit.count != -1) {
|
||||
zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0 TSRMLS_CC, "Cannot seek to %ld which is behind offest %ld plus count %ld", pos, intern->u.limit.offset, intern->u.limit.count);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user