tony2001 Tue Dec 27 22:32:01 2005 EDT
Added files: (Branch: PHP_5_1)
/php-src/ext/standard/tests/array bug35821.phpt
Modified files:
/php-src NEWS
/php-src/ext/standard array.c
Log:
fix #35821 (array_map() segfaults when exception is throwed from the callback)
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.328&r2=1.2027.2.329&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.328 php-src/NEWS:1.2027.2.329
--- php-src/NEWS:1.2027.2.328 Mon Dec 26 16:18:44 2005
+++ php-src/NEWS Tue Dec 27 22:32:01 2005
@@ -7,6 +7,8 @@
- Fixed segfault/leak in imagecolormatch(). (Pierre)
- Fixed small leak in mysqli_stmt_fetch() when bound variable was empty string.
(Andrey)
+- Fixed bug #35821 (array_map() segfaults when exception is throwed from
+ the callback). (Tony)
- Fixed bug #35781 (stream_filter_append() can cause segfault). (Tony)
- Fixed bug #35759 (mysqli_stmt_bind_result() makes huge allocation when
column empty). (Andrey)
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/array.c?r1=1.308.2.13&r2=1.308.2.14&diff_format=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.308.2.13
php-src/ext/standard/array.c:1.308.2.14
--- php-src/ext/standard/array.c:1.308.2.13 Mon Dec 5 22:53:55 2005
+++ php-src/ext/standard/array.c Tue Dec 27 22:32:01 2005
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: array.c,v 1.308.2.13 2005/12/05 22:53:55 sniper Exp $ */
+/* $Id: array.c,v 1.308.2.14 2005/12/27 22:32:01 tony2001 Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -4347,7 +4347,7 @@
fci.params = ¶ms[1];
fci.no_separation = 0;
- if (!zend_call_function(&fci, &fci_cache TSRMLS_CC) ==
SUCCESS && result) {
+ if (!zend_call_function(&fci, &fci_cache TSRMLS_CC) ==
SUCCESS || !result) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "An
error occurred while invoking the map callback");
efree(array_len);
efree(args);
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/tests/array/bug35821.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/array/bug35821.phpt
+++ php-src/ext/standard/tests/array/bug35821.phpt
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php