php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31989 Xmlrpc 'infinite loop' issue in php5 for windows only
Submitted: 2005-02-16 01:27 UTC Modified: 2005-04-01 00:54 UTC
From: grangeway at blueyonder dot co dot uk Assigned: edink (profile)
Status: Closed Package: XMLRPC-EPI related
PHP Version: 5.0.3 OS: Windows
Private report: No CVE-ID: None
 [2005-02-16 01:27 UTC] grangeway at blueyonder dot co dot uk
Description:
------------
The following code works fine in php 4.x for windows, appears to work fine in 4.x/5.x under linux, but in the distributed windows binarys, and also my own compilation, results in an infinite loop, in what appears to be xmlParseChunk. This issue only seems to occur if the xml header i.e. <?xml version='1.0'?> is not included in the response, and it's the windows build.






Reproduce code:
---------------
$foo = "<methodResponse>
<params>
<param>
<value><string>Welcome</string></value>
</param>
</params>
</methodResponse>";
var_dump($foo);
var_dump(xmlrpc_decode($foo));


Expected result:
----------------
Result under freebsd:
> php/bin/php test.php
Content-type: text/html
X-Powered-By: PHP/5.0.4-dev

string(110) "<methodResponse>
<params>
<param>
<value><string>Welcome</string></value>
</param>
</params>
</methodResponse>"
string(7) "Welcome"


Actual result:
--------------
inifinite loop:

char * data=0x00a40528 is "<x></x>"

 	php5ts_debug.dll!_xmlParseDocument()  + 0x5c5	C
 	php5ts_debug.dll!_xmlParseChunk()  + 0xe5	C
>	php5ts_debug.dll!php_XML_Parse(_XML_Parser * parser=0x00a3f060, const unsigned char * data=0x00a40528, int data_len=7, int is_final=1)  Line 481 + 0x18	C
 	php5ts_debug.dll!xml_elem_parse_buf(const char * in_buf=0x00a40528, int len=7, _xml_input_options * options=0x0012f298, _xml_elem_error * error=0x0012f18c)  Line 699 + 0x16	C
 	php5ts_debug.dll!XMLRPC_REQUEST_FromXML(const char * in_buf=0x00a40528, int len=7, _xmlrpc_request_input_options * in_options=0x0012f298)  Line 762 + 0x1c	C
 	php5ts_debug.dll!decode_request_worker(_zval_struct * xml_in=0x00a40440, _zval_struct * encoding_in=0x00000000, _zval_struct * method_name_out=0x00000000)  Line 713 + 0x16	C
 	php5ts_debug.dll!zif_xmlrpc_decode(int ht=1, _zval_struct * return_value=0x00a3f018, _zval_struct * this_ptr=0x00000000, int return_value_used=1, void * * * tsrm_ls=0x00912910)  Line 778 + 0x31	C

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-16 01:49 UTC] sniper@php.net
It's because this extension is linked with libxml2 which this extension DOES NOT support. It should be linked with expat like it is in PHP 4..

 [2005-03-25 01:23 UTC] sniper@php.net
Edin, can you look into this or not?

 [2005-03-28 02:08 UTC] edink@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip


 [2005-04-01 00:54 UTC] grangeway at blueyonder dot co dot uk
This issues seems to now be resolved.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 15:01:29 2024 UTC