mirror of https://github.com/OpenTTD/OpenTTD.git
Fix: [Script] GSAdmin.Send() could generate invalid JSON (#11250)
This commit is contained in:
parent
4eddec9e79
commit
993e7be707
|
@ -129,7 +129,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string json;
|
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) {
|
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.");
|
ScriptLog::Error("You are trying to send a table that is too large to the AdminPort. No data sent.");
|
||||||
|
|
Loading…
Reference in New Issue