From: Volker Lendecke Date: Mon, 26 Oct 2020 08:18:57 +0000 (+0100) Subject: libsmb: Fix a signed/unsigned warning X-Git-Tag: talloc-2.3.2~65 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7ea5c1f05d834ace9a12e193f237aa89ff2be486;p=thirdparty%2Fsamba.git libsmb: Fix a signed/unsigned warning "num_bytes" is uint32_t, "received" is uint16_t. The multiplication seems to implicitly widen "received" to int, leading to a signed/unsigned warning. This cast makes that warning go away. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c index 59404bce7bf..57fefdc382a 100644 --- a/source3/libsmb/clilist.c +++ b/source3/libsmb/clilist.c @@ -465,7 +465,7 @@ static void cli_list_old_done(struct tevent_req *subreq) * I don't think this can wrap. received is * initialized from a 16-bit value. */ - if (num_bytes < (received * DIR_STRUCT_SIZE + 3)) { + if (num_bytes < ((uint32_t)received * DIR_STRUCT_SIZE + 3)) { TALLOC_FREE(subreq); tevent_req_nterror( req, NT_STATUS_INVALID_NETWORK_RESPONSE);