1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 20:13:07 +01:00

Potential fix #11174, #11175. Use Strnlen

Unsure if this will fix the issue as not reproducable. It is possible
that the pointer passed to this function is bad
This commit is contained in:
duncanspumpkin
2020-03-31 19:10:52 +01:00
parent 4be3050e74
commit 6560de0705

View File

@@ -370,7 +370,7 @@ static void format_append_string(char** dest, size_t* size, const utf8* string)
{
if ((*size) == 0)
return;
size_t length = strlen(string);
size_t length = strnlen(string, *size);
if (length < (*size))
{
std::memcpy((*dest), string, length);