From 5e21566201d6bc57a1d9a944acbaa6e671387bae Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 25 Mar 2020 17:41:10 +0100 Subject: [PATCH] coverity 274112 - unintended sign extension --- armsrc/hitagS.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/armsrc/hitagS.c b/armsrc/hitagS.c index 07b445434..78009496e 100644 --- a/armsrc/hitagS.c +++ b/armsrc/hitagS.c @@ -888,8 +888,8 @@ void SimulateHitagSTag(bool tag_mem_supplied, uint8_t *data) { // use the last read tag } - tag.uid = (tag.pages[0][3] << 24 | tag.pages[0][2] << 16 | tag.pages[0][1] << 8 | tag.pages[0][0]); - tag.key = (tag.pages[3][3] << 24 | tag.pages[3][2] << 16 | tag.pages[3][1] << 8 | tag.pages[3][0]); + tag.uid = ((tag.pages[0][3]) << 24) | ((tag.pages[0][2]) << 16) | ((tag.pages[0][1]) << 8) | tag.pages[0][0]; + tag.key = ((tag.pages[3][3]) << 24) | ((tag.pages[3][2]) << 16) | ((tag.pages[3][1]) << 8) | tag.pages[3][0]; tag.key <<= 16; tag.key += ((tag.pages[2][3]) << 8) + tag.pages[2][2]; tag.pwdl0 = tag.pages[2][0];