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;