HTTP upload selze pro 4095 a 4096 bajtu?
Jan Kasprzak
kas na informatics.muni.cz
Pondělí Červenec 28 17:31:20 MEST 2003
Jan Kasprzak wrote:
: Pomoci diff -u CGI.pm z obou verzi Perlu podezrivam nasledujici
: kus kodu v CGI.pm (diff je 5_004_04 oproti 5.8.0):
:
: @@ -3252,7 +3276,8 @@
: substr($self->{BUFFER},0,$bytesToReturn)='';
:
: # If we hit the boundary, remove the CRLF from the end.
: - return ($start > 0) ? substr($returnval,0,-2) : $returnval;
: + return (($start > 0) && ($start <= $bytes))
: + ? substr($returnval,0,-2) : $returnval;
: }
: END_OF_FUNC
Tak si myslim ze to mam - chyba je skutecne v okoli vyse uvedeneho
radku. Pro CGI.pm z 5.005_03 vypada patch takto (pro starsi je jeste predtim
nutno aplikovat vyse uvedenou zmenu.
--- /export/packages/perl-5.005_03/lib/5.00503/CGI.pm 2003-07-28 16:45:49.0000
00000 +0200
+++ ./CGI.pm 2003-07-28 17:28:03.000000000 +0200
@@ -3220,8 +3220,10 @@
substr($self->{BUFFER},0,$bytesToReturn)='';
# If we hit the boundary, remove the CRLF from the end.
+ # MIND THE GAP: compute the end offset from $start, not from
+ # length($returnval)! -Jan "Yenya" Kasprzak, 2003-07-28
return (($start > 0) && ($start - 2 < $bytes))
- ? substr($returnval,0,-2) : $returnval;
+ ? substr($returnval,0,$start-2) : $returnval;
}
END_OF_FUNC
Poslu bug report.
-Yenya
--
| Jan "Yenya" Kasprzak <kas at {fi.muni.cz - work | yenya.net - private}> |
| GPG: ID 1024/D3498839 Fingerprint 0D99A7FB206605D7 8B35FCDE05B18A5E |
| http://www.fi.muni.cz/~kas/ Czech Linux Homepage: http://www.linux.cz/ |
|__ If you want "aesthetics", go play with microkernels. -Linus Torvalds __|
Další informace o konferenci Perl