From 0df7c34986c8d0cac059153f995b593da3f97d89 Mon Sep 17 00:00:00 2001 From: darode Date: Fri, 23 Sep 2011 11:18:26 +0000 Subject: [PATCH] 2011-09-23 Dario Rodriguez * lib/PandoraFMS/NmapParser.pm: Added an error handler to avoid error during NmapParser lib execution. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4990 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 5 +++++ pandora_server/lib/PandoraFMS/NmapParser.pm | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 5c0dd7e812..195fc34f89 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,8 @@ +2011-09-23 Dario Rodriguez + + * lib/PandoraFMS/NmapParser.pm: Added an error handler to avoid + error during NmapParser lib execution. + 2011-09-22 Junichi Satoh * pandora_server_installer: Fixed invalid group settings. diff --git a/pandora_server/lib/PandoraFMS/NmapParser.pm b/pandora_server/lib/PandoraFMS/NmapParser.pm index bfd6b0cf04..6c20baa744 100644 --- a/pandora_server/lib/PandoraFMS/NmapParser.pm +++ b/pandora_server/lib/PandoraFMS/NmapParser.pm @@ -101,8 +101,15 @@ sub callback { sub parse { my $self = shift; $self->_init(); - $self->{twig}->safe_parse(@_); - if ($@) { die $@; } + + eval { + $self->{twig}->safe_parse(@_); + }; + + if ($@) { + return; + } + $self->_clean(); $self->purge; return $self;