Skip to content

Commit

Permalink
minor: Add all-zero sanity check to Revolt-NC5462 (closes merbanan#2715)
Browse files Browse the repository at this point in the history
  • Loading branch information
zuckschwerdt committed Nov 8, 2023
1 parent bd452d9 commit 1e02cdc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/devices/revolt_nc5462.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ static int revolt_nc5462_decode(r_device *decoder, bitbuffer_t *bitbuffer)
uint8_t *b = bitbuffer->bb[0];

int sum = add_bytes(b, 11);
if (sum == 0) {
return DECODE_FAIL_SANITY;
}
int chk = b[11];
if ((sum & 0xff) != chk) {
return DECODE_FAIL_MIC;
Expand Down

0 comments on commit 1e02cdc

Please sign in to comment.