From 808ba4350c813a4ce5c9340115fb714ed23e2ec5 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Thu, 27 Feb 2014 16:50:20 +0200 Subject: [PATCH] Restrict submit size to 25KB (cherry picked from commit fcd3a29c3144870f2a418a0dbf6093da26e6709f) --- lib/Gruntmaster/Page/Submit.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Gruntmaster/Page/Submit.pm b/lib/Gruntmaster/Page/Submit.pm index a30263b..aeffb08 100644 --- a/lib/Gruntmaster/Page/Submit.pm +++ b/lib/Gruntmaster/Page/Submit.pm @@ -33,6 +33,7 @@ sub generate{ die if defined $contest && $contest !~ /^\w+$/ ; die if defined $contest && (time > contest_end $contest); return reply 'A required parameter was not supplied' if grep { !defined } $problem, $format, $prog; + return reply 'Maximum source size is 10KB' if length $prog > 25 * 1024; return reply 'You must wait 30 seconds between jobs' unless time > lastjob ($r->user) + 30; set_lastjob $r->user; -- 2.30.2