hf legic wrbl: fix Out-of-bounds check

Check was off-by-one so that the last byte was not writable.
This commit is contained in:
Uli Heilmeier 2020-04-07 19:58:23 +02:00
commit 75943044a5

View file

@ -681,7 +681,7 @@ static int CmdLegicWrbl(const char *Cmd) {
return PM3_EOUTOFBOUND;
}
if (len + offset >= card.cardsize) {
if (len + offset > card.cardsize) {
PrintAndLogEx(WARNING, "Out-of-bounds, Cardsize = %d, [offset+len = %d ]", card.cardsize, len + offset);
return PM3_EOUTOFBOUND;
}