Subject: | FGCI::Async::BuildParse fails to parse values longer than 127 bytes correctly |
Currently FCGI::Async is a bit broken and unable to correctly parse
incoming request name-value pairs with components longer than 127 bytes.
The reason is that FCGI/Async/BuildParse.pm uses "c" (signed char) in
unpack(), and then verifies value to be greater than 0x7f. By using
unsigned type ("C") the problem should be fixed.
Patch to fix the problem attached.
System information:
Module: CGI::Async 0.10 (latest available)
perl -v: This is perl, v5.8.8 built for i686-linux
uname -a: Linux bt.drdaeman.pp.ru 2.6.18-028stab027 #2 Fri May 25
21:30:26 MSD 2007 i686 Celeron (Coppermine) GenuineIntel GNU/Linux
Thank you.
Subject: | BuildParse.pm.patch |
--- BuildParse.pm.vanilla 2007-11-01 14:02:53.000000000 +0300
+++ BuildParse.pm 2007-11-01 14:03:01.000000000 +0300
@@ -42,7 +42,7 @@
{
# THIS FUNCTION MODIFIES $_[0]
- my $namelen = unpack( "c", $_[0] );
+ my $namelen = unpack( "C", $_[0] );
if ( $namelen > 0x7f ) {
# It's a 4byte
$namelen = unpack( "N", $_[0] ) & 0x7fffffff;
@@ -52,7 +52,7 @@
substr( $_[0], 0, 1 ) = "";
}
- my $valuelen = unpack( "c", $_[0] );
+ my $valuelen = unpack( "C", $_[0] );
if ( $valuelen > 0x7f ) {
# It's a 4byte
$valuelen = unpack( "N", $_[0] ) & 0x7fffffff;