Fixed a potential overrun in the ROM code.

This commit is contained in:
OBattler
2020-01-15 00:39:55 +01:00
parent 2b5425de79
commit 1f4927cdce

View File

@@ -62,7 +62,10 @@ rom_fopen(wchar_t *fn, wchar_t *mode)
{
wchar_t temp[1024];
wcscpy(temp, exe_path);
if (wcslen(exe_path) <= 1024)
wcscpy(temp, exe_path);
else
wcsncpy(temp, exe_path, 1024);
plat_put_backslash(temp);
wcscat(temp, fn);