From 87beabe31cc671cdddf3fb3e70d7bb1d290a8f0b Mon Sep 17 00:00:00 2001 From: Benjamin Larsson Date: Thu, 16 Jul 2026 23:00:11 +0200 Subject: [PATCH] Reject implausible state nibble in waveman (#3611) Real captures (tests/waveman) show the state nibble is always exactly 0xe (ON) or 0x6 (OFF); the code previously treated any value other than 0xe as "OFF", silently accepting 14 of 16 possible nibble values as a false decode. Reject anything but those two observed values instead. --- src/devices/waveman.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/devices/waveman.c b/src/devices/waveman.c index faa35038..83c5822e 100644 --- a/src/devices/waveman.c +++ b/src/devices/waveman.c @@ -62,6 +62,14 @@ static int waveman_callback(r_device *decoder, bitbuffer_t *bitbuffer) | ((b[i] & 0x01) ? 0x00 : 0x08); } + // Only 0xe (ON) and 0x6 (OFF) are valid states in real captures; any other + // value was previously still accepted and reported as "OFF", silently + // letting 14 of 16 possible nibble values through as a false decode. + if (nb[2] != 0xe && nb[2] != 0x6) { + decoder_logf(decoder, 2, __func__, "implausible state nibble: %x", nb[2]); + return DECODE_FAIL_SANITY; + } + id_str[0] = 'A' + nb[0]; id_str[1] = '\0';