php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18457 Crash with XPath
Submitted: 2002-07-21 12:52 UTC Modified: 2002-08-05 05:34 UTC
From: kelcon at ceti dot pl Assigned:
Status: Closed Package: DOM XML related
PHP Version: 4.2.1 OS: Win98
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: kelcon at ceti dot pl
New email:
PHP Version: OS:

 

 [2002-07-21 12:52 UTC] kelcon at ceti dot pl
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";

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-05 05:34 UTC] chregu@php.net
This bug should be fixed in HEAD and PHP_4_2_0 (stable) branch

get it from
http://snaps.php.net/win32/

chregu
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 28 01:01:30 2024 UTC