From 524a439d6ef2b5de4157364b440fa94ff7a13706 Mon Sep 17 00:00:00 2001 From: Yann GASCUEL <34003959+lnv42@users.noreply.github.com> Date: Wed, 24 Jan 2024 13:57:05 +0100 Subject: [PATCH] cmdhf15: dump: fix arg parsing/sanitization --- client/src/cmdhf15.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/src/cmdhf15.c b/client/src/cmdhf15.c index c6eb887c5..c7f9049ac 100644 --- a/client/src/cmdhf15.c +++ b/client/src/cmdhf15.c @@ -1744,7 +1744,7 @@ static int CmdHF15Dump(const char *Cmd) { CLIParserFree(ctx); // sanity checks - if ((scan + unaddressed + uidlen) > 1) { + if ((scan + unaddressed + (uidlen > 0)) > 1) { PrintAndLogEx(WARNING, "Select only one option /scan/unaddress/uid"); return PM3_EINVARG; } @@ -1755,8 +1755,7 @@ static int CmdHF15Dump(const char *Cmd) { } // default fallback to scan for tag. - // overriding unaddress parameter :) - if (uidlen != HF15_UID_LENGTH) { + if (uidlen != HF15_UID_LENGTH && !unaddressed) { scan = true; }