From 9a6a266b16fcd6489fce45fb8920f98ede8815aa Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Fri, 23 Dec 2005 20:32:15 +0000 Subject: [PATCH] - MFH Fixed Bug #35785 (SimpleXML memory read error) --- Zend/zend_execute.c | 2 +- ext/simplexml/tests/bug35785.phpt | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 8e1680d0a4..0e39af6b17 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -548,7 +548,7 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, znode make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ object = *object_ptr; - if (object->type != IS_OBJECT || (opcode == ZEND_ASSIGN_OBJ && !Z_OBJ_HT_P(object)->write_property)) { + if (!object || object->type != IS_OBJECT || (opcode == ZEND_ASSIGN_OBJ && !Z_OBJ_HT_P(object)->write_property)) { zend_error(E_WARNING, "Attempt to assign property of non-object"); FREE_OP(free_op2); if (!RETURN_VALUE_UNUSED(result)) { diff --git a/ext/simplexml/tests/bug35785.phpt b/ext/simplexml/tests/bug35785.phpt index 2c3a54d5d6..34489c5b10 100755 --- a/ext/simplexml/tests/bug35785.phpt +++ b/ext/simplexml/tests/bug35785.phpt @@ -13,10 +13,11 @@ echo $xml->asXML(); --EXPECTF-- -Notice: Undefined index: name in %sbug35785.phpt on line %d +Notice: Undefined index: name in %sbug35785.php on line %d -Strict Standards: Creating default object from empty value in %sbug35785.phpt on line %d +Strict Standards: Creating default object from empty value in %sbug35785.php on line %d -Warning: Attempt to assign property of non-object in %sbug35785.phpt on line %d +Warning: Attempt to assign property of non-object in %sbug35785.php on line %d +===DONE=== -- 2.40.0