From 960ab065e47efafa06fc8698eea47f9925082ed7 Mon Sep 17 00:00:00 2001 From: Nigel Horne Date: Wed, 25 Nov 2020 01:35:21 +0000 Subject: [PATCH] Handle uninitialized variable --- bin/gmail-report | 4 +++- bin/hotmail-report | 4 +++- bin/yahoo-report | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/gmail-report b/bin/gmail-report index ba0dd99..e01f405 100755 --- a/bin/gmail-report +++ b/bin/gmail-report @@ -256,7 +256,9 @@ sub doit { try { my $m = "From MAILER-DAEMON Fri Dec 29 15:21:26 2006\n" . $message; threads->yield(); - $virus = $scanner->scan_scalar(\$m); + if($scanner) { + $virus = $scanner->scan_scalar(\$m); + } } catch ClamAV::Client::Error with { print "Couldn't scan message for viruses\n"; $virus = undef; diff --git a/bin/hotmail-report b/bin/hotmail-report index c594621..0f13e63 100755 --- a/bin/hotmail-report +++ b/bin/hotmail-report @@ -257,7 +257,9 @@ sub doit { try { my $m = "From MAILER-DAEMON Fri Dec 29 15:21:26 2006\n" . $message; threads->yield(); - $virus = $scanner->scan_scalar(\$m); + if($scanner) { + $virus = $scanner->scan_scalar(\$m); + } } catch ClamAV::Client::Error with { print "Couldn't scan message for viruses\n"; $virus = undef; diff --git a/bin/yahoo-report b/bin/yahoo-report index 64b059e..f67c2d4 100755 --- a/bin/yahoo-report +++ b/bin/yahoo-report @@ -270,7 +270,9 @@ sub doit { try { my $m = "From MAILER-DAEMON Fri Dec 29 15:21:26 2006\n" . $message; threads->yield(); - $virus = $scanner->scan_scalar(\$m); + if($scanner) { + $virus = $scanner->scan_scalar(\$m); + } } catch ClamAV::Client::Error with { print "Couldn't scan message for viruses\n"; $virus = undef;