From f4ec8463a4ba13d729d2e1e92d0e1657442ad61d Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Wed, 9 Oct 2019 23:31:22 +0200 Subject: [PATCH] coverity 226367 - strange indala code --- client/cmdlfindala.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/cmdlfindala.c b/client/cmdlfindala.c index 0e308be35..914b510fc 100644 --- a/client/cmdlfindala.c +++ b/client/cmdlfindala.c @@ -109,7 +109,10 @@ static int CmdIndalaDemod(const char *Cmd) { //convert UID to HEX uint32_t uid1 = bytebits_to_byte(DemodBuffer, 32); uint32_t uid2 = bytebits_to_byte(DemodBuffer + 32, 32); - uint64_t foo = (((uint64_t)uid1 << 32) & 0x1FFFFFFF) | (uid2 & 0x7FFFFFFF); + // To be checked, what's this internal ID ? + // foo is only used for 64b ids and in that case uid1 must be only preamble, plus the following code is wrong as x<<32 & 0x1FFFFFFF is always zero + //uint64_t foo = (((uint64_t)uid1 << 32) & 0x1FFFFFFF) | (uid2 & 0x7FFFFFFF); + uint64_t foo = uid2 & 0x7FFFFFFF; if (DemodBufferLen == 64) { PrintAndLogEx(