Closed (fixed)
Project:
Drupal core
Version:
6.x-dev
Component:
xml-rpc system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Jun 2008 at 07:40 UTC
Updated:
16 Jun 2010 at 12:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
clemens.tolboomWith chokes I mean it replaces the WHOLE message with an empty string. (Or was my data corrupt? afaik it was not)
My strpos searches for the first occurrence of '?>' while the preg_replace did an eager search for the last fitting '?>'
Comment #2
clemens.tolboomSteps to reproduce.
1. With devel php block insert the following code
2. Run the php
3. Note that message part is around 87K in size
4. Now change the 80 into 128
5. See the var_dump message containing a NULL value.
Is this memory dependant?
Comment #3
gerhard killesreiter commentedneeds to go into D7 first.
Comment #4
gerhard killesreiter commentedDoes apply to D5 and D6 but needs work for D7.
Comment #5
damien tournoud commentedThis solution looks a little crude to me. What if there is a "?>" in the message but no XML header?
Comment #6
damien tournoud commentedThinking about it, do we really need to strip the <?xml ?> tag.
I also noticed that the parser don't handle correctly the case when
$xmlrpc_message->messagetypeis not set at the end of the parsing (like in the case of a malformed message like the one above).Comment #7
clemens.tolboomI wrote a test for this in #307477: xmlrpc test for big messages..
To run short I cannot reproduce with memory setting 64M.
Lowering to 32M same.
Lowering to 16M makes the whole testsuite die.
So I guess my test is wrong :(
Comment #8
clemens.tolboomI rewrote the test. And it runs ok.
So my guess is this bug is a 'cannot reproduce' unless my test is wrong.
Patch #6 should be investigated. Although I prefer a test for it first.
Comment #9
clemens.tolboomOn third thought ... this is probably PHP version dependent.
My previous PHP version was a Ubuntu 7.04 version on which I reported this issue. I'm not sure how to get this version number :-( On http://packages.ubuntu.com/ choosing Feisty ginve PHP version 5.2.1
My current PHP version is PHP 5.2.4-2ubuntu5.3
So if someone has this older version of PHP he can run the new test #307477: xmlrpc test for big messages..
Comment #10
Anonymous (not verified) commentedThe last submitted patch failed testing.
Comment #11
uccio commentedIn my case the xmlrpc message is about 500K the php is 5.2.9 and the problem is preg_replace().
I have fix the problem in this way.
Comment #12
dave reidMoving to new 'xml-rpc system' component.
Comment #13
damien tournoud commented#529608: xmlrpc_message_parse() in xmlrpc.inc is not safe for big XML-RPC responses marked as a duplicate.
Here is a reroll of my patch from #6.
Comment #14
dixon_#13: 265973-xmlrpc-parse.patch queued for re-testing.
Comment #15
dixon_Here is a clean re-roll for both D7 and D6. I'd love to see this bug getting fixed as this is a real limitation when trying to post large stuff to Drupal via XMLRPC.
Comment #16
dixon_Setting this to critical as it is a broken behavior.
Comment #17
sunIf the response contains the XML declaration, then the directly following trim() and '' check will never be true?
There should be no space between "else" and "if".
Powered by Dreditor.
Comment #18
mr.baileysThe trim() and '' check is no longer required, as the addition of the $xmlrpc_message->messagetype check takes care of messages with an empty body. Dropped it and took care of the space in the else if.
As per Priority levels of Issues, I'm not sure this is critical.
Comment #19
sunAgreed on priority. Would be good to add a test that verifies we can parse either way correctly now.
Comment #20
mr.baileysThe existing XML-RPC tests should be sufficient to assert parsing behavior for valid & well-formed messages. Added a number of unit tests to assert that invalid messages are rejected.
Comment #21
dries commentedCommitted to CVS HEAD, but moving to Drupal 6. I think the patch in #15 is RTBC.
Comment #22
mr.baileysPatch in #15 needed some tweaks (removal of the empty body check and
elseifinstead ofelse if).Comment #23
dixon_#22 applies just fine and receiving large posts also works now!
Comment #24
gábor hojtsyLooked at CVS history, and this XML declaration removal seems to have been in there since the first moment of using our adapted incutio XML-RPC library. So since no reason was uncovered that we'd need it, committed the patch.