Fixed int overflow in printer_write_setting
Thanks to hac425
This commit is contained in:
parent
06c32f1700
commit
8e9b0a625b
@ -107,7 +107,7 @@ static BOOL printer_write_setting(const char* path, prn_conf_t type, const void*
|
|||||||
const char* name = filemap[type];
|
const char* name = filemap[type];
|
||||||
char* abs = GetCombinedPath(path, name);
|
char* abs = GetCombinedPath(path, name);
|
||||||
|
|
||||||
if (!abs)
|
if (!abs || (length > INT32_MAX))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
file = CreateFileA(abs, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
file = CreateFileA(abs, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user