Fixed a string copy in the SST flash code.
This commit is contained in:
@@ -249,7 +249,10 @@ sst_39sf010_init(const device_t *info)
|
|||||||
wchar_t *flash_name = (wchar_t *)malloc(l*sizeof(wchar_t));
|
wchar_t *flash_name = (wchar_t *)malloc(l*sizeof(wchar_t));
|
||||||
swprintf(flash_name, l, L"%ls.bin", machine_name);
|
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_mapping);
|
||||||
mem_mapping_disable(&bios_high_mapping);
|
mem_mapping_disable(&bios_high_mapping);
|
||||||
@@ -298,4 +301,4 @@ const device_t sst_flash_39sf010_device =
|
|||||||
sst_39sf010_close,
|
sst_39sf010_close,
|
||||||
NULL,
|
NULL,
|
||||||
NULL, NULL, NULL, NULL
|
NULL, NULL, NULL, NULL
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user