Bug #18457: Crash with XPath

From: Date: Sun, 21 Jul 2002 16:52:29 +0000
Subject: Bug #18457: Crash with XPath
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-14735@lists.php.net to get a copy of this message
From: kelcon@ceti.pl Operating system: Win98 PHP version: 4.2.1 PHP Bug Type: DOM XML related Bug description: Crash with XPath This code crashesh php (tested via php-cli). When $i less-then condition is set to 100, this code works, but when is greater, it crashes on exit. $content = '<?xml version="1.0" encoding="utf-8"?> <auth xmlns:dt="http://www.nowhere.pl/"> <dt:shadow name="rules" desc="Rules" zygryf="label"/> <rules> <dt:shadow name="rule" desc="Rule" multiple="1" required="0"/> <rule> <dt:shadow name="expr" zygryf="text" desc="Match Expression" zygryf-size="40"/> <expr/> <dt:shadow name="group" desc="Group" multiple="1" required="0"/> <group> <dt:shadow name="name" zygryf="text" desc="Name" zygryf-size="20"/> <name/> <dt:shadow name="read" zygryf="bool" desc="Read"/> <read/> <dt:shadow name="write" zygryf="bool" desc="Write"/> <write/> </group> </rule> </rules> <dt:shadow name="default" desc="Default Rule" zygryf="label"/> <default> <dt:shadow name="group" desc="Group" multiple="1" required="0"/> <group> <dt:shadow name="name" zygryf="text" desc="Name" zygryf-size="20"/> <name/> <dt:shadow name="read" zygryf="bool" desc="Read"/> <read/> <dt:shadow name="write" zygryf="bool" desc="Write"/> <write/> </group> </default> </auth> '; print microtime() . "\n"; $dom = domxml_open_mem($content); for ($i = 0; $i < 300; $i++) { $dom = domxml_open_mem($content); $context = xpath_new_context ($dom); $results = xpath_eval_expression($context,"//*[name() = 'dt:shadow'][@zygryf='text']"); unset($dom); unset($context); unset($results); } print microtime() . "\n"; -- Edit bug report at http://bugs.php.net/?id=18457&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=18457&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=18457&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=18457&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=18457&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=18457&r=support Expected behavior: http://bugs.php.net/fix.php?id=18457&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=18457&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=18457&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=18457&r=globals

« previous php.bugs (#14735) next »