From: Joe Atzberger Date: Tue, 1 Jun 2010 18:50:39 +0000 (+0000) Subject: Catch undef parameter (avoid warning/failure on substr) X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3e634a084044ceb45b513cbf2f050705225fb91d;p=working%2FSIPServer.git Catch undef parameter (avoid warning/failure on substr) --- 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.