From e1bc58692ddd4c9f4af9276da41c66aa8c21eb3f Mon Sep 17 00:00:00 2001 From: Brian Pow Date: Fri, 9 Feb 2018 00:44:17 +0800 Subject: [PATCH] Improved error detection and message if missing paramters for 'hf mf hardnested' --- client/cmdhfmf.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/client/cmdhfmf.c b/client/cmdhfmf.c index 0a99869fd..a42d179ce 100644 --- a/client/cmdhfmf.c +++ b/client/cmdhfmf.c @@ -1261,6 +1261,12 @@ int CmdHF14AMfNestedHard(const char *Cmd) { cmdp+=2; break; default: + if(param_getchar(Cmd, cmdp) == 0x00) + { + PrintAndLog("Block number is missing"); + return 1; + + } blockNo = param_get8(Cmd, cmdp); ctmp = param_getchar(Cmd, cmdp+1); if (ctmp != 'a' && ctmp != 'A' && ctmp != 'b' && ctmp != 'B') { @@ -1276,7 +1282,14 @@ int CmdHF14AMfNestedHard(const char *Cmd) { return 1; } + if(param_getchar(Cmd, cmdp+3) == 0x00) + { + PrintAndLog("Target block number is missing"); + return 1; + + } trgBlockNo = param_get8(Cmd, cmdp+3); + ctmp = param_getchar(Cmd, cmdp+4); if (ctmp != 'a' && ctmp != 'A' && ctmp != 'b' && ctmp != 'B') { PrintAndLog("Target key type must be A or B");