cvs: php-src /ext/dom nodelist.c /ext/dom/tests bug38438.phpt

From: Date: Sun, 13 Aug 2006 15:03:19 +0000
Subject: cvs: php-src /ext/dom nodelist.c /ext/dom/tests bug38438.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-39939@lists.php.net to get a copy of this message
iliaa Sun Aug 13 15:03:19 2006 UTC Modified files: /php-src/ext/dom nodelist.c /php-src/ext/dom/tests bug38438.phpt Log: MFB: Fixed bug #38438 (DOMNodeList->item(0) segfault on empty NodeList) http://cvs.php.net/viewvc.cgi/php-src/ext/dom/nodelist.c?r1=1.21&r2=1.22&diff_format=u Index: php-src/ext/dom/nodelist.c diff -u php-src/ext/dom/nodelist.c:1.21 php-src/ext/dom/nodelist.c:1.22 --- php-src/ext/dom/nodelist.c:1.21 Mon Feb 13 10:23:57 2006 +++ php-src/ext/dom/nodelist.c Sun Aug 13 15:03:19 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: nodelist.c,v 1.21 2006/02/13 10:23:57 dmitry Exp $ */ +/* $Id: nodelist.c,v 1.22 2006/08/13 15:03:19 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -134,7 +134,7 @@ 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) { http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/bug38438.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/dom/tests/bug38438.phpt diff -u /dev/null php-src/ext/dom/tests/bug38438.phpt:1.2 --- /dev/null Sun Aug 13 15:03:19 2006 +++ php-src/ext/dom/tests/bug38438.phpt Sun Aug 13 15:03:19 2006 @@ -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

« previous php.cvs (#39939) next »