fix situation where {'details[]'} doesn't exist for JSON output.

This commit is contained in:
dataking 2017-04-27 13:28:48 -07:00
parent c93bade5b0
commit 9197f84f3d

View File

@ -219,7 +219,7 @@ if ($json) {
push @nlp_new, { 'port' => $port, 'protocol' => $proto, 'owner_process' => $proc };
}
$lynis_report_data{'network_listen_port[]'} = \@nlp_new;
my @details = @{$lynis_report_data{'details[]'}};
my @details = @{$lynis_report_data{'details[]'}} unless (!exists($lynis_report_data{'details[]'}));;
my @det_new;
foreach my $d ( @details ) {
my ($id,$svc,$desc,$nmn) = split(/\|/, $d);