diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/controller/oj/JudgeController.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/controller/oj/JudgeController.java index 38a52304..6165b967 100644 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/controller/oj/JudgeController.java +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/controller/oj/JudgeController.java @@ -107,6 +107,14 @@ public class JudgeController { @Transactional(rollbackFor = Exception.class) public CommonResult submitProblemJudge(@RequestBody ToJudgeDto judgeDto, HttpServletRequest request) { + if (judgeDto.getCode().length() < 50 && !judgeDto.getLanguage().contains("Py")) { + return CommonResult.errorResponse("提交的代码是无效的,代码字符长度请不要低于50!", CommonResult.STATUS_FORBIDDEN); + } + + if (judgeDto.getCode().length() > 65535) { + return CommonResult.errorResponse("提交的代码是无效的,代码字符长度请不要超过65535!", CommonResult.STATUS_FORBIDDEN); + } + // 需要获取一下该token对应用户的数据 HttpSession session = request.getSession(); UserRolesVo userRolesVo = (UserRolesVo) session.getAttribute("userInfo"); @@ -131,10 +139,6 @@ public class JudgeController { redisUtils.expire(lockKey, 3); } - if (judgeDto.getCode().length() < 50 && !judgeDto.getLanguage().contains("Py")) { - return CommonResult.errorResponse("提交的代码是无效的,代码长度请不要低于50!", CommonResult.STATUS_FORBIDDEN); - } - // 将提交先写入数据库,准备调用判题服务器 Judge judge = new Judge(); diff --git a/judger/SandBox-v1.3.10 b/judger/SandBox-v1.3.11 similarity index 71% rename from judger/SandBox-v1.3.10 rename to judger/SandBox-v1.3.11 index 14f529dc..55a78d4a 100644 Binary files a/judger/SandBox-v1.3.10 and b/judger/SandBox-v1.3.11 differ