#41582 [Asn->Csd]: SimpleXML crashes.
| From: | tony2001@php.net | Date: | Tue, 05 Jun 2007 10:03:18 +0000 |
| Subject: | #41582 [Asn->Csd]: SimpleXML crashes. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-113396@lists.php.net to get a copy of this message | ||
ID: 41582
Updated by: tony2001@php.net
Reported By: judas dot iscariote at gmail dot com
-Status: Assigned
+Status: Closed
Bug Type: SimpleXML related
Operating System: Any
PHP Version: 5CVS-2007-06-04 (CVS)
Assigned To: helly
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2007-06-04 10:59:01] tony2001@php.net
Marcus, check the patch out:
http://dev.daylessday.org/diff/bug41582.diff
------------------------------------------------------------------------
[2007-06-04 09:53:24] judas dot iscariote at gmail dot com
Description:
------------
the following code segafaults.
Reproduce code:
---------------
<?php
$xml = new SimpleXMLElement('<?xml version="1.0" standalone="yes"?>
<collection></collection>');
$xml->movie[]->characters->character[0]->name = 'Miss Coder';
//or crashes too ( same issue)
//$xml->movie[0]->characters->character[]->name = 'Miss Coder';
var_dump($xml->asXml());
?>
Expected result:
----------------
Fatal Error: cannot use [] for reading.
Actual result:
--------------
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 47237115809024 (LWP 23360)]
0x000000000056e7d0 in sxe_prop_dim_read (object=0xc94dd8, member=0x0,
elements=0 '\0', attribs=1 '\001', silent=0 '\0')
at /home/cristian/php5/ext/simplexml/simplexml.c:254
254 if (Z_TYPE_P(member) == IS_LONG) {
....
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41582&edit=1