You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sub do_httpx2 {
my ($page, $response, $headers, $server_cert) = &do_httpx3;
X509_free($server_cert) if defined $server_cert;
return ($page, $response, defined $headers ?
map( { ($h,$v)=/^(\S+)\:\s*(.*)$/; (uc($h),$v); }
split(/\s?\n/, $headers)
) : ()
);
}
throws undef warnings if the $headers it receives are malformed. If the header doesn't match the
regex in map, $h will be undef and then uc($h) will throw a warning.
Here's a test program that illustrates it:
$ cat foo.pl
use strict;
use warnings;
use Data::Dumper;
my $headers = "foo: bar\n\nfoo\nbaz:\n";
my %hash = map(
{my ($h,$v)=/^(\S+)\:\s*(.*)$/; (uc($h),$v); }
split(/\s?\n/, $headers)
);
print Dumper(\%hash);
Running:
$ perl foo.pl
Use of uninitialized value $h in uc at foo.pl line 8.
$VAR1 = {
'BAZ' => '',
'' => undef,
'FOO' => 'bar'
};
Also, it looks like do_httpsx4 suffers from the same problem, but I haven't tested it.
I get this error 10-80 times/day in our production web server. Counts from September 2021:
The function do_httpx2:
throws undef warnings if the
$headers
it receives are malformed. If the header doesn't match theregex in
map
,$h
will be undef and thenuc($h)
will throw a warning.Here's a test program that illustrates it:
Running:
Also, it looks like do_httpsx4 suffers from the same problem, but I haven't tested it.
I get this error 10-80 times/day in our production web server. Counts from September 2021:
The text was updated successfully, but these errors were encountered: