diff --git a/smradius/attributes.pm b/smradius/attributes.pm index 397257187d5bd17cc88db0623720983e78d37afd..d4bd8b49194c74c758dfefadafbed97a9431a2fc 100644 --- a/smradius/attributes.pm +++ b/smradius/attributes.pm @@ -68,9 +68,18 @@ sub addAttribute { my ($server,$nattributes,$vattributes,$attribute) = @_; + + # Check we have the name, operator AND value + if (!defined($attribute->{'Name'}) || !defined($attribute->{'Operator'}) || !defined($attribute->{'Value'})) { + $server->log(LOG_DEBUG,"[ATTRIBUTES] Problem adding attribute with name = ".niceUndef($attribute->{'Name'}). + ", operator = ".niceUndef($attribute->{'Operator'}).", value = ".niceUndef($attribute->{'Value'})); + return; + } + # Clean them up a bit $attribute->{'Name'} =~ s/\s*(\S+)\s*/$1/; $attribute->{'Operator'} =~ s/\s*(\S+)\s*/$1/; + # Grab attribue name, operator and value my $name = $attribute->{'Name'}; my $operator = $attribute->{'Operator'};