[pmg-devel] [PATCH pmg-api 2/2] fix 'Use of uninitialized value $info'

Mira Limbeck m.limbeck at proxmox.com
Tue Jun 11 15:27:29 CEST 2019


Return early if $info is not defined. This gets rid of the 'Use of
uninitialized value $info' warning in the following 'split' call.

Signed-off-by: Mira Limbeck <m.limbeck at proxmox.com>
---
 PMG/API2/Quarantine.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/PMG/API2/Quarantine.pm b/PMG/API2/Quarantine.pm
index a51cf1e..b17b7a2 100644
--- a/PMG/API2/Quarantine.pm
+++ b/PMG/API2/Quarantine.pm
@@ -64,6 +64,7 @@ sub decode_spaminfo {
     $spamdesc = PMG::Utils::load_sa_descriptions([$salocaldir]) if !$spamdesc;
 
     my $res = [];
+    return $res if !defined($info);
 
     foreach my $test (split (',', $info)) {
 	my ($name, $score) = split (':', $test);
-- 
2.11.0



More information about the pmg-devel mailing list