From 40bf68d9e3a6f02ee141aa9ae50cc6e2f7393cee Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Tue, 23 Oct 2012 13:23:14 -0400 Subject: [PATCH] LP#1070466: Pack, then unpack total in debug_split_print. The checksum needs to be a 16bit value, so we pack, then unpack the checksum total in debug_split_print to guarantee that. Some longer messages have generated 32-bit checksums. Signed-off-by: Jason Stephenson Signed-off-by: Galen Charlton --- Sip/Checksum.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sip/Checksum.pm b/Sip/Checksum.pm index 389a0f8..71dd59b 100644 --- a/Sip/Checksum.pm +++ b/Sip/Checksum.pm @@ -59,7 +59,8 @@ sub debug_split_print { printf STDERR "= %4d\n\n", $subtotal; } printf STDERR "%56d\n", $total; - return $total; + # Pack, then upack to make sure we have 16-bit value. + return unpack("S", pack("S", $total)); } -- 2.11.0