From: marshmellow42 Date: Sun, 14 Feb 2016 16:42:34 +0000 (-0500) Subject: FIX: Coverity, unintended sign extention, CID #121363, (numbits << 16… X-Git-Tag: v2.3.0~7^2~13 X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/3d4982ddbfebc7eca00daf644ac6dee937488d61 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. from @iceman1001 . --- diff --git a/client/cmdhf14a.c b/client/cmdhf14a.c index 330fbec0..b369d187 100644 --- a/client/cmdhf14a.c +++ b/client/cmdhf14a.c @@ -731,7 +731,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); SendCommand(&c);