Skip Menu |

This queue is for tickets about the FCGI-Async CPAN distribution.

Report information
The Basics
Id: 30407
Status: resolved
Priority: 0/
Queue: FCGI-Async

People
Owner: Nobody in particular
Requestors: bitcard [...] public.drdaeman.pp.ru
Cc:
AdminCc:

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



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;
On Thu Nov 01 07:05:53 2007, drdaeman wrote: Show quoted text
> 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.
Ah - my fault here. I'd actually fixed this in code some time ago, stored in my revision control repo. Looks like I forgot to build a new CPAN dist for it though. I've just uploaded 0.11 to PAUSE; expect to see it on CPAN in an hour or so. -- Paul Evans