Show
Ignore:
Timestamp:
03/09/08 03:58:16 (21 months ago)
Author:
bradfitz
Message:

SECURITY: patch from Jeremey James <jbj@…> to not crash
on zero byte chunked upload when buffered uploads are enabled.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/t/52-chunked-upload.t

    r617 r766  
    184184} 
    185185 
     186# Try a 0 length chunked request, as it used to crash server 
     187{ 
     188    my $hdr = "POST /status HTTP/1.0\r\nTransfer-Encoding: chunked\r\n\r\n0\r\n\r\n"; 
     189    my $sock = IO::Socket::INET->new( PeerAddr => "127.0.0.1:$port" ) 
     190        or return undef; 
     191    my $rv = syswrite($sock, $hdr); 
     192    die unless $rv == length($hdr); 
     193 
     194    # Give it time to crash 
     195    select undef, undef, undef, 1.0; 
     196 
     197    my $sock2 = IO::Socket::INET->new( PeerAddr => "127.0.0.1:$port" ); 
     198    ok ($sock2, 'Server still alive'); 
     199} 
     200 
    1862011;