Skip Menu |

This queue is for tickets about the File-Scan-ClamAV CPAN distribution.

Report information
The Basics
Id: 86411
Status: resolved
Priority: 0/
Queue: File-Scan-ClamAV

People
Owner: ESAYM [...] cpan.org
Requestors: mbroekman [...] maileig.com
Cc:
AdminCc:

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



Subject: uninitialized value in ping()
Date: Tue, 25 Jun 2013 17:10:41 +0000
To: "bug-File-Scan-ClamAV [...] rt.cpan.org" <bug-File-Scan-ClamAV [...] rt.cpan.org>
From: Maarten Broekman <mbroekman [...] maileig.com>
If the ping() function is called and is unable to get a connection to clamd, the following errors are observed: Use of uninitialized value in scalar chomp at …File/Scan/ClamAV.pm line 140. Use of uninitialized value in string eq at …File/Scan/ClamAV.pm line 147. This is because $response is defined in the chomp call and no checking is done to see if it returns a defined value. The change in the return is only to add single-quotes to the error string for readability. DIFF: @@ -137,14 +137,16 @@ my $conn = $self->_get_connection || return; $self->_send($conn, "PING\n"); - chomp(my $response = $conn->getline); + my $response = $conn->getline; + $response = "" if ( ! defined($response) ); + chomp($response); # Run out the buffer? 1 while (<$conn>); $conn->close; - return ($response eq 'PONG' ? 1 : $self->_seterrstr("Unknown reponse from ClamAV service: $response")); + return ($response eq 'PONG' ? 1 : $self->_seterrstr("Unknown reponse from ClamAV service: '$response'")); }
Maarten I haven't been maintaining this module for some time. If you're interested I'd happily pass management of it onto you? Any interest? Regards James Turnbull
Committed to 1.93. Thanks,