#20442 [Ana->Csd]: xml_get_current_line_number produces segmentation fault
ID: 20442
Updated by: iliaa@php.net
Reported By: blizz@0x03.net
-Status: Analyzed
+Status: Closed
Bug Type: XML related
Operating System: NetBSD 1.6
PHP Version: 4CVS-2002-11-15
New Comment:
This bug has been fixed in CVS.
In case this was a PHP problem, 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/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2002-11-15 23:53:57] blizz@0x03.net
okay, sorry. did not know that ;)
------------------------------------------------------------------------
[2002-11-15 16:09:15] iliaa@php.net
This bug is actually the result of a bug in the bundled expat library.
You can fix the problem by installing the latest expat from
http://sourceforge.net/project/showfiles.php?group_id=10127&release_id=109357
I am leaving the bug open, until the bunbled expat library is upgraded
to the latest stable release.
------------------------------------------------------------------------
[2002-11-15 03:54:06] blizz@0x03.net
It looks like the xml_get_current_line_number of xml produces a
segmentation fault.
Here is the piece of code :
function parse($file)
{
if(!($fp = fopen($file, 'r')))
echo "xml_parser error: Could not open
$file.\n";
else
while($data = fgets($fp, 4096))
if(!xml_parse($this->parser, $data,
feof($fp)))
echo 'xml_parser error: ',
xml_error_string(xml_get_error_code($this->parser)),
' at line ',
xml_get_current_line_number($this->parser),
"\n";
fclose($fp);
return $this->struct;
}
If the data.xml looks like this for example :
<Example>
<Test>Bla</Test>
<Test>Muh</test>
</Example>
I runned the xml example file in shell and here is the output :
Example
Test
Test
xml_parser error: mismatched tag at line 4
xml_parser error: mismatched tag at line Segmentation fault (core
dumped)
Now where is the problem ?
Does the XML parser try to get the line and is already at the end of
the file ?
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=20442&edit=1
Thread (4 messages)