MFB: Fixed bug #38438 (DOMNodeList->item(0) segfault on empty NodeList)

This commit is contained in:
Ilia Alshanetsky 2006-08-13 15:03:19 +00:00
parent 2c2125ad56
commit a41723d0f4
2 changed files with 14 additions and 1 deletions

View File

@ -134,7 +134,7 @@ PHP_FUNCTION(dom_nodelist_item)
zval_copy_ctor(return_value);
return;
}
} else {
} else if (objmap->baseobj) {
nodep = dom_object_get_node(objmap->baseobj);
if (nodep) {
if (objmap->nodetype == XML_ATTRIBUTE_NODE || objmap->nodetype == XML_ELEMENT_NODE) {

View File

@ -0,0 +1,13 @@
--TEST--
Bug #38438 (DOMNodeList->item(0) segfault on empty NodeList)
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$list = new DOMNodeList();
var_dump($list->item(0));
echo "OK\n";
?>
--EXPECT--
NULL
OK