Fixed int overflow in printer_write_setting

Thanks to hac425
This commit is contained in:
akallabeth 2020-04-29 15:49:09 +02:00
parent 06c32f1700
commit 8e9b0a625b

View File

@ -107,7 +107,7 @@ static BOOL printer_write_setting(const char* path, prn_conf_t type, const void*
const char* name = filemap[type];
char* abs = GetCombinedPath(path, name);
if (!abs)
if (!abs || (length > INT32_MAX))
return FALSE;
file = CreateFileA(abs, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);