diff --git a/armsrc/BigBuf.c b/armsrc/BigBuf.c index e45993e73..27ed42f62 100644 --- a/armsrc/BigBuf.c +++ b/armsrc/BigBuf.c @@ -308,6 +308,11 @@ bool LogTrace_ISO15693(const uint8_t *bytes, uint16_t len, uint32_t ts_start, ui // specific LogTrace function for bitstreams: the partial byte size is stored in first parity byte. E.g. bitstream "1100 00100010" -> partial byte: 4 bits bool RAMFUNC LogTraceBits(const uint8_t *btBytes, uint16_t bitLen, uint32_t timestamp_start, uint32_t timestamp_end, bool reader2tag) { + + if ( bitLen == 0 ) { + return false; + } + uint8_t parity[(nbytes(bitLen) - 1) / 8 + 1]; memset(parity, 0x00, sizeof(parity)); // parity has amount of leftover bits.