Just another Perl shrine | |
PerlMonks |
Re: Re: Bad Practiceby isotope (Deacon) |
on Feb 27, 2003 at 20:28 UTC ( [id://239245]=note: print w/replies, xml ) | Need Help?? |
From version 2.91:
So CGI.pm is verifying that it's a positive number. Further, within read_from_client(), it calls read(), which only uses the length as an upper bound. The logic then seems to flow like this: If the Content-length header is missing, assume 0. If it's there, and greater than zero, then try to read from the client until you reach the end of the input, or the value of content_length, whichever comes first. Granted, Lincoln didn't explicitly verify that content_length is an integer, but the above code and the call to read() should cover that. Treating %XY in a URL as the literal "%XY" makes more sense to me than trying to unescape it and coming up with '\0', but that's probably just me. CGI.pm isn't perfect, but I'd trust it a whole lot more than this snippet bastardized from cgi-lib.pl, especially coupled with the loop that does create global variables named for the CGI parameter names. --isotope
In Section
Seekers of Perl Wisdom
|
|