From 4c443bce5cf042265099d5239d8958d2e61a6793 Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 4 Jul 2013 16:36:47 +0000 Subject: (svn r25555) -Fix [FS#5632]: [Script] Texts from scripts were not validated before they were shown, causing an assertion to trigger --- src/script/api/script_text.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/script/api') 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); -- cgit v1.2.3-70-g09d2