]> granicus.if.org Git - php/commitdiff
- Fix issue with LimitIterator and bounds checking
authorMarcus Boerger <helly@php.net>
Fri, 3 Mar 2006 23:34:49 +0000 (23:34 +0000)
committerMarcus Boerger <helly@php.net>
Fri, 3 Mar 2006 23:34:49 +0000 (23:34 +0000)
ext/spl/spl_iterators.c

index 1f0cc9edd1800c4583c7aa91d132abafca82fa39..5cc9064ddd3bf9fe982facf0485b404dbc69f1b1 100755 (executable)
@@ -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;
        }