]> granicus.if.org Git - php/commitdiff
Fixed crash demonstrated with ext/dom/tests/dom003.phpt test case.
authorIlia Alshanetsky <iliaa@php.net>
Fri, 5 Dec 2003 01:44:45 +0000 (01:44 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Fri, 5 Dec 2003 01:44:45 +0000 (01:44 +0000)
Zend/zend_default_classes.c
Zend/zend_exceptions.c

index 8fdb245cb3c0690be48183460717e07bdcf4ba0e..2679f0a9b8108a2f94e68528feedb6d5e73689e1 100644 (file)
@@ -481,9 +481,9 @@ ZEND_API void zend_exception_error(zval *exception TSRMLS_DC)
                EG(exception) = NULL;
                
                MAKE_STD_ZVAL(str);
-               handler->cast_object(exception, str, IS_STRING, 0 TSRMLS_CC);
-
-               zend_update_property_string(default_exception_ptr, exception, "string", sizeof("string")-1, EG(exception) ? Z_OBJCE_P(exception)->name : Z_STRVAL_P(str) TSRMLS_CC);
+               if (handler->cast_object(exception, str, IS_STRING, 0 TSRMLS_CC) != FAILURE) {
+                       zend_update_property_string(default_exception_ptr, exception, "string", sizeof("string")-1, EG(exception) ? Z_OBJCE_P(exception)->name : Z_STRVAL_P(str) TSRMLS_CC);
+               }
                zval_ptr_dtor(&str);
        
                if (EG(exception)) {
index 8fdb245cb3c0690be48183460717e07bdcf4ba0e..2679f0a9b8108a2f94e68528feedb6d5e73689e1 100644 (file)
@@ -481,9 +481,9 @@ ZEND_API void zend_exception_error(zval *exception TSRMLS_DC)
                EG(exception) = NULL;
                
                MAKE_STD_ZVAL(str);
-               handler->cast_object(exception, str, IS_STRING, 0 TSRMLS_CC);
-
-               zend_update_property_string(default_exception_ptr, exception, "string", sizeof("string")-1, EG(exception) ? Z_OBJCE_P(exception)->name : Z_STRVAL_P(str) TSRMLS_CC);
+               if (handler->cast_object(exception, str, IS_STRING, 0 TSRMLS_CC) != FAILURE) {
+                       zend_update_property_string(default_exception_ptr, exception, "string", sizeof("string")-1, EG(exception) ? Z_OBJCE_P(exception)->name : Z_STRVAL_P(str) TSRMLS_CC);
+               }
                zval_ptr_dtor(&str);
        
                if (EG(exception)) {