cvs: php-src(PHP_5_1) /ext/spl spl_iterators.c
| From: | Marcus Boerger | Date: | Sun, 01 Jan 2006 19:48:11 +0000 |
| Subject: | cvs: php-src(PHP_5_1) /ext/spl spl_iterators.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-36349@lists.php.net to get a copy of this message | ||
helly Sun Jan 1 19:48:11 2006 UTC
Modified files: (Branch: PHP_5_1)
/php-src/ext/spl spl_iterators.c
Log:
- Fix SEGV when rewind() not set
http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_iterators.c?r1=1.73.2.17&r2=1.73.2.18&diff_format=u
Index: php-src/ext/spl/spl_iterators.c
diff -u php-src/ext/spl/spl_iterators.c:1.73.2.17 php-src/ext/spl/spl_iterators.c:1.73.2.18
--- php-src/ext/spl/spl_iterators.c:1.73.2.17 Sun Jan 1 12:50:13 2006
+++ php-src/ext/spl/spl_iterators.c Sun Jan 1 19:48:11 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_iterators.c,v 1.73.2.17 2006/01/01 12:50:13 sniper Exp $ */
+/* $Id: spl_iterators.c,v 1.73.2.18 2006/01/01 19:48:11 helly Exp $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -2045,7 +2045,9 @@
iter = Z_OBJCE_P(obj)->get_iterator(Z_OBJCE_P(obj), obj TSRMLS_CC);
- iter->funcs->rewind(iter TSRMLS_CC);
+ if (iter->funcs->rewind) {
+ iter->funcs->rewind(iter TSRMLS_CC);
+ }
while (iter->funcs->valid(iter TSRMLS_CC) == SUCCESS) {
key_type = iter->funcs->get_current_key(iter, &str_key, &str_key_len, &int_key
TSRMLS_CC);
iter->funcs->get_current_data(iter, &data TSRMLS_CC);