mirror of https://github.com/OpenRCT2/OpenRCT2.git
Use strndup when setting last_run_version
gConfigGeneral.last_run_version should have the string value copied to, otherwise the SafeFree in config_set_property could try freeing value from stack if used.
This commit is contained in:
parent
5b9a98a0f9
commit
17e5a0d356
|
@ -203,7 +203,7 @@ bool openrct2_initialise()
|
|||
gOpenRCT2ShowChangelog = true;
|
||||
if (gConfigGeneral.last_run_version != NULL && (strcmp(gConfigGeneral.last_run_version, OPENRCT2_VERSION) == 0))
|
||||
gOpenRCT2ShowChangelog = false;
|
||||
gConfigGeneral.last_run_version = OPENRCT2_VERSION;
|
||||
gConfigGeneral.last_run_version = strndup(OPENRCT2_VERSION, strlen(OPENRCT2_VERSION));
|
||||
config_save_default();
|
||||
|
||||
// TODO add configuration option to allow multiple instances
|
||||
|
|
Loading…
Reference in New Issue