php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38438 DOMNodeList->item(0) segfault
Submitted: 2006-08-12 22:50 UTC Modified: 2006-08-13 15:03 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: gmblar at gmail dot com Assigned:
Status: Closed Package: DOM XML related
PHP Version: 5CVS OS: *
Private report: No CVE-ID: None
 [2006-08-12 22:50 UTC] gmblar at gmail dot com
Description:
------------
Segmentation fault (core dumped)

Reproduce code:
---------------
<?php

$list = new DOMNodeList();
var_dump($list->item(0));

?>

Expected result:
----------------
NULL


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-12 23:02 UTC] derick@php.net
Confirmed on Linux with 5.2 cvs:

Program received signal SIGSEGV, Segmentation fault.
0x080dcdb0 in dom_object_get_node (obj=0x0)
    at /dat/dev/php/php-5.2dev/ext/dom/php_dom.c:231
231             if (obj->ptr != NULL) {
(gdb) bt
#0  0x080dcdb0 in dom_object_get_node (obj=0x0)
    at /dat/dev/php/php-5.2dev/ext/dom/php_dom.c:231
#1  0x080f1801 in zif_dom_nodelist_item (ht=1, return_value=0xb78d3e2c,
    return_value_ptr=0x0, this_ptr=0xb78d36f4, return_value_used=1)
    at /dat/dev/php/php-5.2dev/ext/dom/nodelist.c:138
#2  0x083c54c3 in zend_do_fcall_common_helper_SPEC (execute_data=0xbfdc0294)
    at zend_vm_execute.h:200
#3  0x083c643c in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (execute_data=0xbfdc0294)
    at zend_vm_execute.h:322
#4  0x083c5026 in execute (op_array=0xb78d3728) at zend_vm_execute.h:92
#5  0x083a27c3 in zend_execute_scripts (type=8, retval=0x0, file_count=3)
    at /dat/dev/php/php-5.2dev/Zend/zend.c:1095
#6  0x083526a8 in php_execute_script (primary_file=0xbfdc268c)
    at /dat/dev/php/php-5.2dev/main/main.c:1759
#7  0x0841b1b3 in main (argc=1, argv=0xbfdc27b4)
    at /dat/dev/php/php-5.2dev/sapi/cli/php_cli.c:1097

 [2006-08-13 15:03 UTC] iliaa@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC