From 8e9b0a625bbeb55c0e00c96f2e9bf9a2677a374c Mon Sep 17 00:00:00 2001 From: akallabeth Date: Wed, 29 Apr 2020 15:49:09 +0200 Subject: [PATCH] Fixed int overflow in printer_write_setting Thanks to hac425 --- channels/printer/client/printer_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels/printer/client/printer_main.c b/channels/printer/client/printer_main.c index 39a474999..dbcc07dc5 100644 --- a/channels/printer/client/printer_main.c +++ b/channels/printer/client/printer_main.c @@ -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);