From 241a51bf35e4af0d974f563b61219ffa117c3f58 Mon Sep 17 00:00:00 2001 From: slerena Date: Mon, 13 Jun 2011 14:03:59 +0000 Subject: [PATCH] 2011-06-13 Sancho Lerena * Tools.pm: Avoid errors when provide an empty string to md5. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4437 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 2 ++ pandora_server/lib/PandoraFMS/Tools.pm | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index a62b57e8f4..b64d553efc 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,5 +1,7 @@ 2011-06-13 Sancho Lerena + * Tools.pm: Avoid errors when provide an empty string to md5. + * NetworkServer.pm: Avoid warning messages on pandora_server.error 2011-06-10 Ramon Novoa diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm index 9b7466d586..de62e62952 100644 --- a/pandora_server/lib/PandoraFMS/Tools.pm +++ b/pandora_server/lib/PandoraFMS/Tools.pm @@ -575,6 +575,10 @@ sub md5_init () { sub md5 ($) { my $str = shift; + if (!defined($str)){ + return ""; + } + # Note: All variables are unsigned 32 bits and wrap modulo 2^32 when calculating # Initialize variables