Fixed a string copy in the SST flash code.

This commit is contained in:
OBattler
2020-01-14 19:33:17 +01:00
committed by GitHub
parent 1861d8cb0d
commit c0946552bc

View File

@@ -249,7 +249,10 @@ sst_39sf010_init(const device_t *info)
wchar_t *flash_name = (wchar_t *)malloc(l*sizeof(wchar_t));
swprintf(flash_name, l, L"%ls.bin", machine_name);
wcscpy(flash_path, flash_name);
if (wcslen(flash_name) <= 1024)
wcscpy(flash_path, flash_name);
else
wcsncpy(flash_path, flash_name, 1024);
mem_mapping_disable(&bios_mapping);
mem_mapping_disable(&bios_high_mapping);
@@ -298,4 +301,4 @@ const device_t sst_flash_39sf010_device =
sst_39sf010_close,
NULL,
NULL, NULL, NULL, NULL
};
};