php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60842 CR+LF bug on chunk_size
Submitted: 2012-01-22 22:24 UTC Modified: 2012-03-08 20:14 UTC
Votes:3
Avg. Score:4.7 ± 0.5
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:1 (33.3%)
From: 120122 at jxs dot nl Assigned: iliaa (profile)
Status: Closed Package: SOAP related
PHP Version: 5.3.9 OS: any
Private report: No CVE-ID: None
 [2012-01-22 22:24 UTC] 120122 at jxs dot nl
Description:
------------
The soap extension has a bug in parsing the chunk_size of messages with Transfer-Encoding: chunked. When the other end is sending CR+LF (a Windows server), only the CR is read to the chunk_size variable, while the LF is prepended to the message body. In that case, the actual XML message is one byte short at the end.

This issue was reported before ( https://bugs.php.net/bug.php?id=51775 ), but never fixed.

Test script:
---------------
<?php $client = new SoapClient("ProcessExternalUser.wsdl", array(
        "location"     => "http://webservices-acc.cibg.nl/Ribiz/Openbaar.asmx",
        "uri"          => "http://services.cibg.nl/ExternalUser/ListHcpApprox",
        'trace'=>1
        )
);

$message = new stdClass();
$message->WebSite = 'Ribiz';
$message->RegistrationNumber = '59023925501';
$x=$client->ListHcpApprox($message);
print_r($x);


Expected result:
----------------
stdClass Object
(
    [ListHcpApprox] => stdClass Object
        (
            [ListHcpApprox] => stdClass Object
                (
                    [HcpNumber] => 239255
                    [BirthSurname] => Smalen
                    [Prefix] => de
...

Actual result:
--------------
PHP Fatal error:  Uncaught SoapFault exception: [HTTP] Error Fetching http body, No Content-Length, connection closed or chunked data in /home/jxs.nl/a.php:13
Stack trace:
#0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'http://webservi...', 'http://services...', 1, 0)
#1 /home/jxs.nl/soap/a.php(13): SoapClient->__call('ListHcpApprox', Array)
#2 /home/jxs.nl/soap/a.php(13): SoapClient->ListHcpApprox(Object(stdClass))
#3 {main}
  thrown in /home/jxs.nl/soap/a.php on line 13


Patches

soap-crlf.jxs.patch (last revision 2012-01-22 22:24 UTC by 120122 at jxs dot nl)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-03-08 20:14 UTC] iliaa@php.net
Automatic comment from SVN on behalf of iliaa
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=324027
Log: Fixed bug #60842, #51775 (Chunked response parsing error when chunksize length line is &gt; 10 bytes).
 [2012-03-08 20:14 UTC] iliaa@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: iliaa
 [2012-03-08 20:14 UTC] iliaa@php.net
This bug has been fixed in SVN.

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/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2012-04-18 09:45 UTC] laruence@php.net
Automatic comment on behalf of iliaa
Revision: http://git.php.net/?p=php-src.git;a=commit;h=d54e6ce832a8ea2efe6009a14b1065050d1998e2
Log: Fixed bug #60842, #51775 (Chunked response parsing error when chunksize length line is &gt; 10 bytes).
 [2012-07-24 23:36 UTC] rasmus@php.net
Automatic comment on behalf of iliaa
Revision: http://git.php.net/?p=php-src.git;a=commit;h=d54e6ce832a8ea2efe6009a14b1065050d1998e2
Log: Fixed bug #60842, #51775 (Chunked response parsing error when chunksize length line is &gt; 10 bytes).
 [2013-11-17 09:33 UTC] laruence@php.net
Automatic comment on behalf of iliaa
Revision: http://git.php.net/?p=php-src.git;a=commit;h=d54e6ce832a8ea2efe6009a14b1065050d1998e2
Log: Fixed bug #60842, #51775 (Chunked response parsing error when chunksize length line is &gt; 10 bytes).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 12:01:29 2024 UTC