From 5e10138aa7c00e32a0fd70b6d8361f63b27e734e Mon Sep 17 00:00:00 2001 From: Joe Atzberger Date: Tue, 1 Jun 2010 18:50:39 +0000 Subject: [PATCH] Catch undef parameter (avoid warning/failure on substr) --- Sip/Checksum.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sip/Checksum.pm b/Sip/Checksum.pm index da3fbaa..7e84ab1 100644 --- a/Sip/Checksum.pm +++ b/Sip/Checksum.pm @@ -86,7 +86,7 @@ sub verify_cksum { my $cksum; my $shortsum; - return 0 if (substr($pkt, -6, 2) ne "AZ"); # No checksum at end + return 0 if (not defined($pkt) or substr($pkt, -6, 2) ne "AZ"); # No checksum at end # Convert the checksum back to hex and calculate the sum of the # pack without the checksum. -- 2.11.0