CC: | Christian Hesse <mail [...] eworm.de> |
Subject: | [PATCH 1/1] fix use of uninitialized value |
Date: | Fri, 26 Sep 2014 18:40:32 +0200 |
To: | bug-Authen-Radius [...] rt.cpan.org |
From: | Christian Hesse <mail [...] eworm.de> |
I get warning:
Use of uninitialized value $vendor_name in hash element at
/usr/share/perl5/vendor_perl/Authen/Radius.pm line 440.
This fixes the problem and sets $vendor_name to 'not defined'.
---
Radius.pm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Radius.pm b/Radius.pm
index db56f23..b88db32 100644
--- a/Radius.pm
+++ b/Radius.pm
@@ -436,7 +436,8 @@ sub vendorID ($) {
return defined $dict_vendor_name{ $attr->{'Vendor'} }{'id'} ? $dict_vendor_name{ $attr->{'Vendor'} }{'id'} : int($attr->{'Vendor'});
} else {
# look up vendor by attribute name
- my $vendor_name = $dict_name{$attr->{'Name'}}{'vendor'};
+ my $vendor_name = defined ($dict_name{$attr->{'Name'}}{'vendor'}) ?
+ $dict_name{$attr->{'Name'}}{'vendor'} : 'not defined';
my $vendor_id = defined ($dict_vendor_name{$vendor_name}{'id'}) ?
$dict_vendor_name{$vendor_name}{'id'} : 'not defined';
return $vendor_id;
--
2.1.1