]> granicus.if.org Git - php/commitdiff
- Fixed Bug #35785 (SimpleXML memory read error)
authorMarcus Boerger <helly@php.net>
Fri, 23 Dec 2005 20:31:39 +0000 (20:31 +0000)
committerMarcus Boerger <helly@php.net>
Fri, 23 Dec 2005 20:31:39 +0000 (20:31 +0000)
Zend/zend_execute.c
ext/simplexml/tests/bug35785.phpt

index dc4f2bd3f65d6c400d4908d65c3bdda1b8cee3a2..a22d3915c0a2d2d7af6df778f7b674cb49ac7b89 100644 (file)
@@ -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)) {
index 2c3a54d5d68a3d7d0b6637ee9a1b48ce638ad56c..34489c5b10ae2719866f20a75abe716d9d5045ac 100755 (executable)
@@ -13,10 +13,11 @@ echo $xml->asXML();
 <?php exit(0); __halt_compiler(); ?>
 --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
 <?xml version="1.0"?>
 <root/>
+===DONE===