From 75943044a56b068be2535c219437c4fe5eeea7fb Mon Sep 17 00:00:00 2001 From: Uli Heilmeier Date: Tue, 7 Apr 2020 19:58:23 +0200 Subject: [PATCH] hf legic wrbl: fix Out-of-bounds check Check was off-by-one so that the last byte was not writable. --- client/cmdhflegic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/cmdhflegic.c b/client/cmdhflegic.c index c6de1379d..901ec85d0 100644 --- a/client/cmdhflegic.c +++ b/client/cmdhflegic.c @@ -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; }