Skip to content

Commit

Permalink
Handle uninitialized variable
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Nov 25, 2020
1 parent 5e40453 commit 960ab06
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion bin/gmail-report
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion bin/hotmail-report
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion bin/yahoo-report
Expand Up @@ -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;
Expand Down

0 comments on commit 960ab06

Please sign in to comment.