From 512293874285f5de82e37a11befb52ff9373d9cb Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Wed, 28 Oct 2009 11:08:33 +0000 Subject: [PATCH] - Merge revision 289987, Fixed bug #49142 (crash when exception thrown from __tostring()) --- NEWS | 2 ++ Zend/zend.c | 12 +++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 8fa9721707..b8a77e742c 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,8 @@ PHP NEWS - Fixed crash in com_print_typeinfo when an invalid typelib is given. (Pierre) +- Fixed bug #49142 (crash when exception thrown from __tostring()). + (David Soria Parra) - Fixed bug #49986 (Missing ICU DLLs on windows package). (Pierre) - Fixed bug #48752 (Crash during date parsing with invalid date). (Pierre) diff --git a/Zend/zend.c b/Zend/zend.c index a139ad999f..8faf0d37e3 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -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; -- 2.40.0