From 98424c20a30089516a2f3ab85790ae82e65f5832 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Tue, 3 Oct 2017 12:48:14 +0200 Subject: [PATCH] Replace a 32 bit shift with two 16 bit shifts. The behaviour of a 32 bit shift on a 32 bit integer is undefined. Replace it with two 16 bit shifts to make it work on a 32 bit Perl. Ref pandora_enterprise#1417. --- pandora_agents/unix/pandora_agent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 6f62a5189c..a7fce3cb3d 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1363,7 +1363,7 @@ sub md5 { # Append bit /* bit, not byte */ length of unpadded message as 64-bit # little-endian integer to message. $msg .= unpack ("B32", pack ("V", $bit_len)); - $msg .= unpack ("B32", pack ("V", $bit_len >> 32)); + $msg .= unpack ("B32", pack ("V", ($bit_len >> 16) >> 16)); # Process the message in successive 512-bit chunks. for (my $i = 0; $i < length ($msg); $i += 512) {