From 8f48da411f0c4274209d1c73e5adebb3bf958f72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Tue, 30 Jan 2018 15:51:29 +0100 Subject: [PATCH] Allocate enough space for scenario name --- src/openrct2/world/Park.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index b9b4808ea0..f1f3d3161c 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -768,7 +768,7 @@ void update_park_fences_around_tile(sint32 x, sint32 y) void park_set_name(const char *name) { // Required else the pointer arithmetic in the game commands below could cause an access violation - char* newName = (char *)malloc(USER_STRING_MAX_LENGTH + 1); + char* newName = (char *)malloc(USER_STRING_MAX_LENGTH + 5); strncpy(newName, name, USER_STRING_MAX_LENGTH); gGameCommandErrorTitle = STR_CANT_RENAME_PARK;