diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 05f6ae163e..e290076778 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -2,6 +2,7 @@ ------------------------------------------------------------------------ - Feature: [#14071] “Vandals stopped” statistic for security guards. - Fix: [#13894] Block brakes do not animate. +- Fix: [#14315] Crash when trying to rename Air Powered Vertical Coaster in Korean. 0.3.3 (2021-03-13) ------------------------------------------------------------------------ diff --git a/src/openrct2-ui/windows/TextInput.cpp b/src/openrct2-ui/windows/TextInput.cpp index 42da994c76..bdeb2555ad 100644 --- a/src/openrct2-ui/windows/TextInput.cpp +++ b/src/openrct2-ui/windows/TextInput.cpp @@ -105,7 +105,10 @@ public: void SetText(std::string_view text, size_t maxLength) { - _buffer = text; + char* tmp = new char[maxLength]; + safe_strcpy(tmp, std::string(text).c_str(), maxLength); + _buffer = tmp; + delete[] tmp; _buffer.resize(maxLength); _maxInputLength = maxLength; gTextInput = context_start_text_input(_buffer.data(), maxLength);