1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-30 06:50:24 +03:00

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 <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2020-10-26 09:18:57 +01:00 committed by Jeremy Allison
parent 40cec27636
commit 7ea5c1f05d

View File

@ -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);