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