Subject: | A valid filenumber with value 0 should be valid |
The fileno method in IO::Socket::SSL tests the validity of its
_SSL_fileno field without checking to see if it is defined. With the
current code, if its value is 0, it is assumed to be invalid and
$self->SUPER::fileno() is called for the return value. The correct
fileno return should be 0 in this case.
I've attached a simple patch that seems to fix this problem.
Subject: | IO-Socket-SSL-0.97.patch |
--- /usr/lib/perl5/vendor_perl/5.8.7/IO/Socket/SSL.pm 2005-07-16 18:25:02.000000000 -0600
+++ lib/IO/Socket/SSL.pm 2006-03-29 14:43:59.000000000 -0700
@@ -331,0 +331,0 @@
sub fileno {
my $self = shift;
- return ${*$self}{'_SSL_fileno'} || $self->SUPER::fileno();
+ return defined ${*$self}{'_SSL_fileno'} ?
+ ${*$self}{'_SSL_fileno'} :
+ $self->SUPER::fileno();
}