helly Fri Mar 3 23:34:49 2006 UTC
Modified files:
/php-src/ext/spl spl_iterators.c
Log:
- Fix issue with LimitIterator and bounds checking
http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_iterators.c?r1=1.116&r2=1.117&diff_format=u
Index: php-src/ext/spl/spl_iterators.c
diff -u php-src/ext/spl/spl_iterators.c:1.116
php-src/ext/spl/spl_iterators.c:1.117
--- php-src/ext/spl/spl_iterators.c:1.116 Fri Mar 3 21:35:16 2006
+++ php-src/ext/spl/spl_iterators.c Fri Mar 3 23:34:49 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_iterators.c,v 1.116 2006/03/03 21:35:16 helly Exp $ */
+/* $Id: spl_iterators.c,v 1.117 2006/03/03 23:34:49 helly Exp $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -1493,7 +1493,7 @@
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;
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php