summaryrefslogtreecommitdiff
path: root/src/script/api/script_text.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/api/script_text.cpp')
-rw-r--r--src/script/api/script_text.cpp2
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);