From aacc4b228245b9b01106e0e588395bb42bd8a486 Mon Sep 17 00:00:00 2001 From: Kevin Easton Date: Thu, 20 Oct 2016 21:42:10 +1100 Subject: [PATCH] Fix unsigned/signed comparison in process_dcc_send1() The result of read() can be -1, and if that is compared against the unsigned result of sizeof it will be converted to SIZE_MAX. Cast the result of sizeof to a signed type. --- source/dcc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/dcc.c b/source/dcc.c index ca16868..52759d6 100644 --- a/source/dcc.c +++ b/source/dcc.c @@ -1850,7 +1850,7 @@ char *buffer = alloca(MAX_DCC_BLOCK_SIZE+1); } if (numbytes) { - if (read(snum, &bytes, sizeof(u_32int_t)) < sizeof(u_32int_t)) + if (read(snum, &bytes, sizeof bytes) < (int)sizeof bytes) { erase_dcc_info(snum, 1, convert_output_format("$G %RDCC%n Remote closed dcc send", NULL)); close_socketread(snum);