From 1e02cdc0c949b0ae4a8b82ac98baf5f11b6bc593 Mon Sep 17 00:00:00 2001 From: "Christian W. Zuckschwerdt" Date: Wed, 8 Nov 2023 22:00:57 +0100 Subject: [PATCH] minor: Add all-zero sanity check to Revolt-NC5462 (closes #2715) --- src/devices/revolt_nc5462.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/devices/revolt_nc5462.c b/src/devices/revolt_nc5462.c index 7273df97d..17066bdf4 100644 --- a/src/devices/revolt_nc5462.c +++ b/src/devices/revolt_nc5462.c @@ -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;