Skip Menu |

This queue is for tickets about the SOAP-Lite CPAN distribution.

Report information
The Basics
Id: 78692
Status: resolved
Priority: 0/
Queue: SOAP-Lite

People
Owner: Nobody in particular
Requestors: aharper [...] ecstuning.com
Cc: steve [...] deefs.net
AdminCc:

Bug Information
Severity: Important
Broken in: 0.715
Fixed in: (no value)



Subject: Sending large object (many levels deep) throws error Incorrect parameter at line 1993.
When sending a large object (many levels deep) through SOAP::Lite, I get an error: Incorrect parameter at /usr/lib/perl5/site_perl/5.8.8/SOAP/Lite.pm line 1993. Line 1993: die "Incorrect parameter" unless $itself =~/^\d$/; I changed this line to: die "Incorrect parameter" unless $itself =~/^\d+$/; and everything works fine.
On Tue Jul 31 07:49:48 2012, aharper wrote: Show quoted text
> When sending a large object (many levels deep) through SOAP::Lite, I > get an error: Incorrect > parameter at /usr/lib/perl5/site_perl/5.8.8/SOAP/Lite.pm line 1993. > > Line 1993: die "Incorrect parameter" unless $itself =~/^\d$/; > > I changed this line to: die "Incorrect parameter" unless $itself > =~/^\d+$/; > and everything works fine.
Issue (and patch) confirmed. Please apply this ASAP. (PS. timestamps in the Changelog file would also be appreciated.) :)
BTW this seems to be a regression from 0.714.
I'm seeing this same issue also with a WWW::Salesforce->login call. Works fine on 0.714.
We've had this reported to us as well: http://www.opsview.com/forum/opsview- enterprise/latest-release/upgrade-42-and-perl-plugin-error-uses-soaplite-module-soluti Please find attached a test case which shows the error and tests it works properly. I can confirm that aharper and ether's fix work. Ton
Subject: payload_large_tree.patch
--- 02-payload.t.original 2012-11-30 04:32:19.000000000 +0000 +++ 02-payload.t 2012-11-30 04:30:30.000000000 +0000 @@ -97,6 +97,12 @@ <item2 xsi:type="xsd:int">60</item2> <item2 xsi:type="xsd:int">100</item2> <item3 xsi:type="xsd:int">200</item3> +<item3 xsi:type="xsd:int">200</item3> +<item4 xsi:type="xsd:int">200</item4> +<item4 xsi:type="xsd:int">200</item4> +<item5 xsi:type="xsd:int">400</item5> +<item5 xsi:type="xsd:int">450</item5> +<item6 xsi:type="xsd:int">600</item6> </nums> </m:doublerResponse> </soap:Body> @@ -108,6 +114,9 @@ ok($deserialized->valueof("$result/[1]") == 20); ok($deserialized->valueof("$result/[3]") == 60); ok($deserialized->valueof("$result/[5]") == 200); + ok($deserialized->valueof("$result/[9]") == 400); + # Test more than 9 items to check depth is okay - RT78692 + ok($deserialized->valueof("$result/[11]") == 600); # match should return true/false in boolean context (and object ref otherwise) ok($deserialized->match('aaa') ? 0 : 1);
From: ppisar [...] redhat.com
Dne Út 31.čec.2012 10:49:48, aharper napsal(a): Show quoted text
> When sending a large object (many levels deep) through SOAP::Lite, I > get an error: Incorrect > parameter at /usr/lib/perl5/site_perl/5.8.8/SOAP/Lite.pm line 1993. >
Cumulative patch is attached with the fix and tests. -- Petr
Subject: SOAP-Lite-0.715-Accept-more-digit-number-in-_traverse.patch
From fc370b31446533cc74a03f2af3949370a07e9980 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> Date: Mon, 6 May 2013 14:22:16 +0200 Subject: [PATCH] Accept more-digit number in _traverse() When sending a large object (many levels deep) through SOAP::Lite, you got an error: Incorrect parameter at /usr/lib/perl5/site_perl/5.8.8/SOAP/Lite.pm line 1993. This fixes wrong check for a number. Thanks to aharper[...]ecstuning.com and TONVOON[...]cpan.org. <https://rt.cpan.org/Public/Bug/Display.html?id=78692> --- lib/SOAP/Lite.pm | 2 +- t/02-payload.t | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/SOAP/Lite.pm b/lib/SOAP/Lite.pm index 691e675..a37b27a 100644 --- a/lib/SOAP/Lite.pm +++ b/lib/SOAP/Lite.pm @@ -1990,7 +1990,7 @@ sub match { sub _traverse { my ($self, $pointer, $itself, $path, @path) = @_; - die "Incorrect parameter" unless $itself =~/^\d$/; + die "Incorrect parameter" unless $itself =~/^\d+$/; if ($path && substr($path, 0, 1) eq '{') { $path = join '/', $path, shift @path while @path && $path !~ /}/; diff --git a/t/02-payload.t b/t/02-payload.t index 6501ac1..1ab5171 100644 --- a/t/02-payload.t +++ b/t/02-payload.t @@ -10,7 +10,7 @@ BEGIN { use strict; use Test; -BEGIN { plan tests => 131 } +BEGIN { plan tests => 133 } use SOAP::Lite; $SIG{__WARN__} = sub { ; }; # turn off deprecation warnings @@ -97,6 +97,12 @@ my($a, $s, $r, $serialized, $deserialized); <item2 xsi:type="xsd:int">60</item2> <item2 xsi:type="xsd:int">100</item2> <item3 xsi:type="xsd:int">200</item3> +<item3 xsi:type="xsd:int">200</item3> +<item4 xsi:type="xsd:int">200</item4> +<item4 xsi:type="xsd:int">200</item4> +<item5 xsi:type="xsd:int">400</item5> +<item5 xsi:type="xsd:int">450</item5> +<item6 xsi:type="xsd:int">600</item6> </nums> </m:doublerResponse> </soap:Body> @@ -108,6 +114,9 @@ my($a, $s, $r, $serialized, $deserialized); ok($deserialized->valueof("$result/[1]") == 20); ok($deserialized->valueof("$result/[3]") == 60); ok($deserialized->valueof("$result/[5]") == 200); + ok($deserialized->valueof("$result/[9]") == 400); + # Test more than 9 items to check depth is okay - RT78692 + ok($deserialized->valueof("$result/[11]") == 600); # match should return true/false in boolean context (and object ref otherwise) ok($deserialized->match('aaa') ? 0 : 1); -- 1.8.1.4
Resolved in 0.716