Skip Menu |

This queue is for tickets about the Rapid7-NeXpose-API CPAN distribution.

Report information
The Basics
Id: 75229
Status: new
Priority: 0/
Queue: Rapid7-NeXpose-API

People
Owner: Nobody in particular
Requestors: jaldridge [...] tanagerinc.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.03
Fixed in: (no value)



Subject: Return handling for "login" doesn't catch non-hash result
A run time error reported that an empty string could not be used as a hash reference in "login" when attempting to test "$xmlh->{'LoginResponse'}->[0]->{'success'}==1". Adding "$xmlh or return '';" ahead of that "if" test and after the call to "xml_request" resolved the problem (leaving the API user to test for the empty string as the other error handling for this module does). The resulting code segment in "login" appears as follows: ##################################################### my $xmlh = $self->xml_request($hashref); $xmlh or return ''; if ($xmlh->{'LoginResponse'}->[0]->{'success'}==1) { ##################################################### Note that the empty result returned by "xml_request" was due to a proxy login error, though this could not be diagnosed until the above code was added and the debug mode problem (Ticket 75227) was addressed. My Perl version: v5.10.1 (*) built for i686-cygwin-thread-multi-64int uname -a: CYGWIN_NT-5.1 sysl930 1.7.9(0.237/5/3) 2011-03-29 10:10 i686 Cygwin