From 4c685ac887bb6b83473330e31888b2165243f881 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Tue, 12 Jan 2016 22:33:54 +0100 Subject: [PATCH] FIX: Coverity, unintended sign extention, CID #121363, (numbits << 16) becomes int, then uint64_t. But the signness might set all upper bits to 1 in the process. --- client/cmdhf14a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/cmdhf14a.c b/client/cmdhf14a.c index 6d94d33b..ea222448 100644 --- a/client/cmdhf14a.c +++ b/client/cmdhf14a.c @@ -735,7 +735,7 @@ int CmdHF14ACmdRaw(const char *cmd) { // Max buffer is USB_CMD_DATA_SIZE datalen = (datalen > USB_CMD_DATA_SIZE) ? USB_CMD_DATA_SIZE : datalen; - c.arg[1] = (datalen & 0xFFFF) | (numbits << 16); + c.arg[1] = (datalen & 0xFFFF) | (uint32_t)(numbits << 16); memcpy(c.d.asBytes,data,datalen); clearCommandBuffer(); -- 2.39.5