Skip Menu |
 

This queue is for tickets about the Net-Server CPAN distribution.

Report information
The Basics
Id: 118312
Status: new
Priority: 0/
Queue: Net-Server

People
Owner: Nobody in particular
Requestors: LUX [...] cpan.org
Cc: cpan [...] iotti.biz
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 2.007
  • 2.008
Fixed in: (no value)



CC: cpan [...] iotti.biz
Subject: Warnings in Net::Server::Proto::SSLEAY
Download (untitled) / with headers
text/plain 1.6k
W wrote Paul Seamons about this, but had no answer. Let's try here. I am using Net::Server::Proto::SSLEAY (from Net::Server 2.007 in CnetOS6; perl is 5.10) in a small perl web server based on HTTP::Server::Simple::CGI::PreFork, which in turn extends HTTP::Server::Simple. I am getting really lots of warnings like this in the logs (one warning for every octet received): Use of uninitialized value $_[1] in substr at /usr/share/perl5/vendor_perl/Net/Server/Proto/SSLEAY.pm line 313, <$read> line ... Line 313 is the line with substr in the read sub: sub read { my ($client, $buf, $size, $offset) = @_; my ($ok, $read) = $client->read_until($size, undef, 1); substr($_[1], $offset || 0, defined($buf) ? length($buf) : 0, $read); return length $read; } The read sub is being called with a undef buffer by the HTTP::Server::Simple module, with sysread( STDIN, my $buff, 1 ). Using an undef buffer seems reasonable, since we have to read, so the buffer has to be written by read. The following patch simply eliminated my warnings. I would like to ask if it could be safe and in case if it (or another correction) could be included in a future release --- /usr/share/perl5/vendor_perl/Net/Server/Proto/SSLEAY.pm.orig 2016-09-25 09:03:39.385323059 +0200 +++ /usr/share/perl5/vendor_perl/Net/Server/Proto/SSLEAY.pm 2016-09-25 09:04:35.233305406 +0200 @@ -306,6 +306,7 @@ sub read { my ($client, $buf, $size, $offset) = @_; my ($ok, $read) = $client->read_until($size, undef, 1); + defined($_[1]) or $_[1] = ''; substr($_[1], $offset || 0, defined($buf) ? length($buf) : 0, $read); return length $read; } Thank you, best regards Luigi Iotti


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.