Subject: | Net::Nessus::XMLRPC fails does not check for empty scans |
Date: | Mon, 19 Mar 2012 13:52:13 +0100 |
To: | bug-Net-Nessus-XMLRPC [...] rt.cpan.org |
From: | Martin Schobert <martin [...] mailbeschleuniger.de> |
Hello,
I use the Net::Nessus::XMLRPC module to connect to a nessus instance.
When I list scans using the function scan_list_uids() and there are no
scans in the task list, perl issues a warning:
Can't use string ("") as a HASH ref while "strict refs" in ...
The is because the XMLRPC modules accesses a hash element, which is not
a reference. So, an empty scan set looks like this, after it is
processed by XMLin:
'scans' => [ { 'scanList' => [ '' ] ] } ]
And XMLin parses:
<scanList></scanList>
So far, it looks correct. However, in scan_list_uids() there is an
access to:
$xmls->{'contents'}->[0]->{'scans'}->[0]->{'scanList'}->[0]->{'scan'}
This results in a warning.
I attached a diff.
Regards,
Martin Schobert
Message body is not shown because sender requested not to inline it.
Message body not shown because it is not plain text.