diff options
author | rubidium <rubidium@openttd.org> | 2013-07-04 16:36:47 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2013-07-04 16:36:47 +0000 |
commit | 4c443bce5cf042265099d5239d8958d2e61a6793 (patch) | |
tree | 910e1724668d86722a74d6344279249642b2005b /src/script/api | |
parent | 76566fde5b92828be695afb14a8307b61d3d9049 (diff) | |
download | openttd-4c443bce5cf042265099d5239d8958d2e61a6793.tar.xz |
(svn r25555) -Fix [FS#5632]: [Script] Texts from scripts were not validated before they were shown, causing an assertion to trigger
Diffstat (limited to 'src/script/api')
-rw-r--r-- | src/script/api/script_text.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/script/api/script_text.cpp b/src/script/api/script_text.cpp index 577dd813e..f87b2e8b2 100644 --- a/src/script/api/script_text.cpp +++ b/src/script/api/script_text.cpp @@ -72,6 +72,7 @@ SQInteger ScriptText::_SetParam(int parameter, HSQUIRRELVM vm) sq_getstring(vm, -1, &value); this->params[parameter] = strdup(SQ2OTTD(value)); + ValidateString(this->params[parameter]); break; } @@ -147,6 +148,7 @@ SQInteger ScriptText::_set(HSQUIRRELVM vm) const SQChar *key; sq_getstring(vm, 2, &key); const char *key_string = SQ2OTTD(key); + ValidateString(key_string); if (strncmp(key_string, "param_", 6) != 0 || strlen(key_string) > 8) return SQ_ERROR; k = atoi(key_string + 6); |