Subject: | Misinterpretation of ssl_write_all return value |
IO::Socket::SSL misinterprets the return value of Net::SSLeay::ssl_write_all (Net::SSLeay version 1.22): the latter function returns undef upon failure, and IO::Socket::SSL checks for <0. The attached patch fixes that (both conditions, undef and <0, now elicit an error).
--- /usr/share/perl5/IO/Socket/SSL.pm Thu Sep 26 19:47:55 2002
+++ src/perllib/IO/Socket/SSL.pm Thu Apr 29 16:56:12 2004
@@ -212,7 +212,8 @@
my $written = &Net::SSLeay::ssl_write_all
($ssl, \substr($$buffer, $offset+$[, $length));
- return $self->error("SSL write error") if ($written<0);
+ return $self->error("SSL write error") if
+ (!defined($written) || $written<0);
return $written;
}