Subject: | Incorrect check of error value in generic_write |
generic_write does not properly check the written value for errors from
NET::SSLeay::write calls, which causes a:
Use of uninitialized value in numeric lt (<)
when Net:SSLeay::ssl_write_all has an error
Also the Net::SSLeay::write_partial returns the value from SSL_write
which can return 0 or -1 if it was not successful
Have included patch file
Subject: | generic_write_error.patch |
diff -r -U 3 -N IO-Socket-SSL-1.26/SSL.pm IO-Socket-SSL-1.26_patchedWrite/SSL.pm
--- IO-Socket-SSL-1.26/SSL.pm 2009-07-03 02:29:28.000000000 -0500
+++ IO-Socket-SSL-1.26_patchedWrite/SSL.pm 2009-07-23 16:53:56.000000000 -0500
@@ -649,7 +649,9 @@
} else {
$written = Net::SSLeay::write_partial( $ssl,$offset,$length,$$buffer );
}
- $written = undef if $written < 0; # Net::SSLeay::write returns -1 not undef on error
+ # Net::SSLeay::ssl_write_all returns (undef,errs) or undef on error
+ # Net::SSLeay::write_partial returns 0 or -1 on error
+ $written = undef if ( defined $written && $written < 1 );
if ( !defined($written) ) {
$self->_set_rw_error( $ssl,-1 )
|| $self->error("SSL write error");