From 6560de0705df94a37af20630ebc87b9b0e7bc494 Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Tue, 31 Mar 2020 19:10:52 +0100 Subject: [PATCH] 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 --- src/openrct2/localisation/Localisation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/localisation/Localisation.cpp b/src/openrct2/localisation/Localisation.cpp index ef881fee36..515f79c802 100644 --- a/src/openrct2/localisation/Localisation.cpp +++ b/src/openrct2/localisation/Localisation.cpp @@ -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);