1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-12 09:09:09 +00:00

Fix: [Script] GSAdmin.Send() could generate invalid JSON (#11250)

This commit is contained in:
Patric Stout
2023-08-31 18:52:52 +02:00
committed by GitHub
parent 4eddec9e79
commit 993e7be707

@@ -129,7 +129,10 @@
}
std::string json;
ScriptAdmin::MakeJSON(vm, -1, SQUIRREL_MAX_DEPTH, json);
if (!ScriptAdmin::MakeJSON(vm, -1, SQUIRREL_MAX_DEPTH, json)) {
sq_pushinteger(vm, 0);
return 1;
}
if (json.length() > NETWORK_GAMESCRIPT_JSON_LENGTH) {
ScriptLog::Error("You are trying to send a table that is too large to the AdminPort. No data sent.");