]> granicus.if.org Git - php/commitdiff
- Fixed bug #49142 (crash when exception thrown from __tostring())
authorDavid Soria Parra <dsp@php.net>
Tue, 27 Oct 2009 13:02:36 +0000 (13:02 +0000)
committerDavid Soria Parra <dsp@php.net>
Tue, 27 Oct 2009 13:02:36 +0000 (13:02 +0000)
NEWS
Zend/zend.c

diff --git a/NEWS b/NEWS
index 71d62c394dc4d791dfddf57305f9453149aecd52..730d887ace9d3ed0503a48f16925d82468fc0e0c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,8 @@ PHP                                                                        NEWS
 - Fixed memory leak in extension loading when an error occurs on Windows.
   (Pierre)
 
+- Fixed bug #49142 (crash when exception thrown from __tostring()).
+  (David Soria Parra)
 - Fixed bug #49990 (SNMP3 warning message about security level printed twice).
   (Jani)
 - Fixed bug #49985 (pdo_pgsql prepare() re-use previous aborted
index a139ad999f99d74414b430c98fd280c531d1c30f..8faf0d37e373a04623bc8c37233b76617291d616 100644 (file)
@@ -1067,9 +1067,15 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
                        if (!EG(active_symbol_table)) {
                                zend_rebuild_symbol_table(TSRMLS_C);
                        }
-                       Z_ARRVAL_P(z_context) = EG(active_symbol_table);
-                       Z_TYPE_P(z_context) = IS_ARRAY;
-                       zval_copy_ctor(z_context);
+
+                       /* during shutdown the symbol table table can be still null */
+                       if (!EG(active_symbol_table)) {
+                               Z_TYPE_P(z_context) = IS_NULL;
+                       } else {
+                               Z_ARRVAL_P(z_context) = EG(active_symbol_table);
+                               Z_TYPE_P(z_context) = IS_ARRAY;
+                               zval_copy_ctor(z_context);
+                       }
 
                        params = (zval ***) emalloc(sizeof(zval **)*5);
                        params[0] = &z_error_type;