]> granicus.if.org Git - php/commitdiff
MF51: fix #35821 (array_map() segfaults when exception is throwed from the callback)
authorAntony Dovgal <tony2001@php.net>
Tue, 27 Dec 2005 22:33:40 +0000 (22:33 +0000)
committerAntony Dovgal <tony2001@php.net>
Tue, 27 Dec 2005 22:33:40 +0000 (22:33 +0000)
ext/standard/array.c

index 40b8d13574d428f50ff5805ee2d84ed1c6df31a9..b7225ae15adaf6f209fa7ad47b3a5bc8e6884fd8 100644 (file)
@@ -4603,7 +4603,7 @@ PHP_FUNCTION(array_map)
                        fci.params = &params[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);