cvs: php-src(PHP_5_3) /ext/spl spl_iterators.c /ext/spl/tests bug46031.phpt
| From: | Arnaud Le Blanc | Date: | Tue, 09 Sep 2008 19:44:15 +0000 |
| Subject: | cvs: php-src(PHP_5_3) /ext/spl spl_iterators.c /ext/spl/tests bug46031.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-53010@lists.php.net to get a copy of this message | ||
lbarnaud Tue Sep 9 19:44:15 2008 UTC
Added files: (Branch: PHP_5_3)
/php-src/ext/spl/tests bug46031.phpt
Modified files:
/php-src/ext/spl spl_iterators.c
Log:
MFH: Fixed bug #46031 (Segfault in AppendIterator::next)
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_iterators.c?r1=1.73.2.30.2.28.2.13&r2=1.73.2.30.2.28.2.14&diff_format=u
Index: php-src/ext/spl/spl_iterators.c
diff -u php-src/ext/spl/spl_iterators.c:1.73.2.30.2.28.2.13
php-src/ext/spl/spl_iterators.c:1.73.2.30.2.28.2.14
--- php-src/ext/spl/spl_iterators.c:1.73.2.30.2.28.2.13 Fri Aug 8 22:07:07 2008
+++ php-src/ext/spl/spl_iterators.c Tue Sep 9 19:44:15 2008
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_iterators.c,v 1.73.2.30.2.28.2.13 2008/08/08 22:07:07 colder Exp $ */
+/* $Id: spl_iterators.c,v 1.73.2.30.2.28.2.14 2008/09/09 19:44:15 lbarnaud Exp $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -1445,6 +1445,9 @@
static inline int spl_dual_it_valid(spl_dual_it_object *intern TSRMLS_DC)
{
+ if (!intern->inner.iterator) {
+ return FAILURE;
+ }
/* FAILURE / SUCCESS */
return intern->inner.iterator->funcs->valid(intern->inner.iterator TSRMLS_CC);
}
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/bug46031.phpt?view=markup&rev=1.1
Index: php-src/ext/spl/tests/bug46031.phpt
+++ php-src/ext/spl/tests/bug46031.phpt
--TEST--
Bug #46031 (Segfault in AppendIterator::next)
--FILE--
<?php
$x = new AppendIterator();
var_dump($x->next());
?>
--EXPECT--
NULL