From 472b6a8c64a6d1921e025704771bf43c992f8818 Mon Sep 17 00:00:00 2001 From: Yann GASCUEL <34003959+lnv42@users.noreply.github.com> Date: Wed, 24 Jan 2024 17:32:26 +0100 Subject: [PATCH] cmdhf15: fix sanity check (uidlen alone is > 1 when -u is set) --- client/src/cmdhf15.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/cmdhf15.c b/client/src/cmdhf15.c index 84e677946..7fa90d6d8 100644 --- a/client/src/cmdhf15.c +++ b/client/src/cmdhf15.c @@ -936,7 +936,7 @@ static int CmdHF15Info(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; } @@ -1639,7 +1639,7 @@ static int CmdHF15WriteDsfid(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; } @@ -2588,7 +2588,7 @@ static int CmdHF15Restore(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; }