Safe check in sprint_bytebits_bin_break

This commit is contained in:
Philippe Teuwen 2021-08-22 17:02:44 +02:00
commit fdba7c2ff8

View file

@ -313,10 +313,14 @@ char *sprint_bytebits_bin_break(const uint8_t *data, const size_t len, const uin
char c = data[i]; char c = data[i];
// manchester wrong bit marker // manchester wrong bit marker
if (c == 7) if (c == 7) {
c = '.'; c = '.';
else } else if (c < 2) {
c += '0'; c += '0';
} else {
PrintAndLogEx(ERR, "Invalid data passed to sprint_bytebits_bin_break()");
return buf;
}
*(tmp++) = c; *(tmp++) = c;