From: Marcus Boerger Date: Fri, 23 Dec 2005 20:31:39 +0000 (+0000) Subject: - Fixed Bug #35785 (SimpleXML memory read error) X-Git-Tag: RELEASE_1_0_4~247 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1edb0395ab16f82de08e3b7f42add24487a10f8a;p=php - Fixed Bug #35785 (SimpleXML memory read error) --- diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index dc4f2bd3f6..a22d3915c0 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -572,7 +572,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===