Patch by Myk Melez <myk@mozilla.org>.
r=bbaetz,gerv
}
+
+sub ValidateComment {
+ # Make sure a comment is not too large (greater than 64K).
+
+ my ($comment) = @_;
+
+ if (defined($comment) && length($comment) > 65535) {
+ DisplayError("Comments cannot be longer than 65,535 characters.");
+ exit;
+ }
+}
+
+
# check and see if a given string actually represents a positive
# integer, and abort if not.
#
{
confirm_login();
ValidateBugID($::FORM{'bugid'});
+ ValidateComment($::FORM{'comment'});
validateFilename();
validateData();
validateDescription();
elsif ($action eq "update")
{
confirm_login();
+ ValidateComment($::FORM{'comment'});
validateID();
validateCanEdit($::FORM{'id'});
validateDescription();
confirm_login();
+ValidateComment($::FORM{'comment'});
+
my $cookiepath = Param("cookiepath");
print "Set-Cookie: PLATFORM=$::FORM{'product'} ; path=$cookiepath ; expires=Sun, 30-Jun-2029 00:00:00 GMT\n" if ( exists $::FORM{'product'} );
print "Set-Cookie: VERSION-$::FORM{'product'}=$::FORM{'version'} ; path=$cookiepath ; expires=Sun, 30-Jun-2029 00:00:00 GMT\n" if ( exists $::FORM{'product'} && exists $::FORM{'version'} );
DuplicateUserConfirm();
}
+ValidateComment($::FORM{'comment'});
+
######################################################################
# End Data/Security Validation
######################################################################