mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
judge: fix
This commit is contained in:
2 files changed
+4
-1
No files matched your search
@@ -1,12 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/hydrojudge",
|
"name": "@hydrooj/hydrojudge",
|
||||||
"bin": "bin/hydrojudge.js",
|
"bin": "bin/hydrojudge.js",
|
||||||
"version": "3.3.5",
|
"version": "3.3.6",
|
||||||
"main": "./src/index.ts",
|
"main": "./src/index.ts",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@hydrooj/utils": "workspace:*",
|
"@hydrooj/utils": "workspace:*",
|
||||||
|
"adm-zip": "0.5.5",
|
||||||
"cac": "^6.7.14",
|
"cac": "^6.7.14",
|
||||||
"p-queue": "^8.0.1",
|
"p-queue": "^8.0.1",
|
||||||
"schemastery": "^3.14.3",
|
"schemastery": "^3.14.3",
|
||||||
@@ -18,6 +19,7 @@
|
|||||||
"preferUnplugged": true,
|
"preferUnplugged": true,
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@types/adm-zip": "^0.4.34",
|
||||||
"@types/shell-quote": "^1.7.5",
|
"@types/shell-quote": "^1.7.5",
|
||||||
"@types/ws": "^8.5.10"
|
"@types/ws": "^8.5.10"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,6 +151,7 @@ export default class VJ4 implements Session {
|
|||||||
const zip = new AdmZip(tmpFilePath);
|
const zip = new AdmZip(tmpFilePath);
|
||||||
const entries = zip.getEntries();
|
const entries = zip.getEntries();
|
||||||
if (entries.length > 512) throw new FormatError('Too many files');
|
if (entries.length > 512) throw new FormatError('Too many files');
|
||||||
|
if (Math.sum(entries.map((i) => i.header.size)) > 256 * 1024 * 1024) throw new FormatError('File too large');
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
zip.extractAllToAsync(savePath, true, (e) => {
|
zip.extractAllToAsync(savePath, true, (e) => {
|
||||||
if (e) reject(e);
|
if (e) reject(e);
|
||||||
|
|||||||
Reference in new issue
Block a user