From e1160b15e4f9eadd34a73ead595eee9d96a1bebc Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Wed, 4 Apr 2012 13:28:21 +0000 Subject: [PATCH] 2012-04-04 Ramon Novoa * lib/PandoraFMS/WMIServer.pm: Put a regexp that could crash the server inside an eval. Fixes bug #3509354. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5900 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 5 +++++ pandora_server/lib/PandoraFMS/WMIServer.pm | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 1f80461e48..6121a922d0 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,8 @@ +2012-04-04 Ramon Novoa + + * lib/PandoraFMS/WMIServer.pm: Put a regexp that could crash the server + inside an eval. Fixes bug #3509354. + 2012-04-03 Ramon Novoa * lib/PandoraFMS/NetworkServer.pm: Fixed the return value of diff --git a/pandora_server/lib/PandoraFMS/WMIServer.pm b/pandora_server/lib/PandoraFMS/WMIServer.pm index b717dd8dbd..f0dc9b1eb9 100644 --- a/pandora_server/lib/PandoraFMS/WMIServer.pm +++ b/pandora_server/lib/PandoraFMS/WMIServer.pm @@ -189,7 +189,10 @@ sub data_consumer ($$) { # Regexp if ($module->{'snmp_community'} ne ''){ my $filter = $module->{'snmp_community'}; - $module_data = ($module_data =~ /$filter/) ? 1 : 0; + eval { + no warnings; + $module_data = ($module_data =~ /$filter/) ? 1 : 0; + }; } my $utimestamp = time ();