Fixed a potential overrun in the ATi EEPROM code.

This commit is contained in:
OBattler
2020-01-15 00:34:28 +01:00
parent 2fe6ea0e64
commit dfc4347e9a

View File

@@ -59,7 +59,10 @@ void ati_eeprom_load(ati_eeprom_t *eeprom, wchar_t *fn, int type)
{
FILE *f;
eeprom->type = type;
wcscpy(eeprom->fn, fn);
if (wcslen(fn) <= 256)
wcscpy(eeprom->fn, fn);
else
wcsncpy(eeprom->fn, fn, 256);
f = nvr_fopen(eeprom->fn, L"rb");
if (!f)
{