From 0a3836bde391e05e1e265da4652630569f481082 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Sat, 7 Nov 2009 12:58:49 -0800 Subject: [PATCH] Add non-numeric package check to USPS driver. --- lib/WebGUI/Shop/ShipDriver/USPS.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/WebGUI/Shop/ShipDriver/USPS.pm b/lib/WebGUI/Shop/ShipDriver/USPS.pm index 8c66d8e35..d4c32b91f 100644 --- a/lib/WebGUI/Shop/ShipDriver/USPS.pm +++ b/lib/WebGUI/Shop/ShipDriver/USPS.pm @@ -199,7 +199,7 @@ sub _calculateFromXML { my $id = $package->{ID}; my $rate = $package->{Postage}->{Rate}; ##Error check for invalid index - if ($id < 0 || $id > $#shippableUnits) { + if ($id < 0 || $id > $#shippableUnits || $id !~ /^\d+$/) { WebGUI::Error::Shop::RemoteShippingRate->throw(error => "Illegal package index returned by USPS: $id"); } if (exists $package->{Error}) {