From 2218b4e7db5ecc06b266ee27e033e56daa937f73 Mon Sep 17 00:00:00 2001 From: Eloff Date: Wed, 27 Jan 2021 14:43:50 +0300 Subject: [PATCH] minor fix --- client/src/cmdtrace.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/client/src/cmdtrace.c b/client/src/cmdtrace.c index d53f47883..a95503813 100644 --- a/client/src/cmdtrace.c +++ b/client/src/cmdtrace.c @@ -615,7 +615,7 @@ int CmdTraceList(const char *Cmd) { "trace list -t hitags -> interpret as " _YELLOW_("HitagS") " communications\n" "trace list -t lto -> interpret as " _YELLOW_("LTO-CM") " communications\n" "trace list -t cryptorf -> interpret as " _YELLOW_("CryptoRF") " communitcations\n" - "trace list -t mf -d -> use dictionary keys file\n" + "trace list -t mf --dict -> use dictionary keys file\n" "trace list -t 14a -f -> show frame delay times\n" "trace list -t 14a -1 -> use trace buffer " ); @@ -630,7 +630,7 @@ int CmdTraceList(const char *Cmd) { arg_lit0("x", NULL, "show hexdump to convert to pcap(ng)\n" " or to import into Wireshark using encapsulation type \"ISO 14443\""), arg_strx0("t", "type", NULL, "protocol to annotate the trace"), - arg_strx0("d", "dict", NULL, "use dictionary keys file"), + arg_strx0(NULL, "dict", "", "use dictionary keys file"), arg_param_end }; CLIExecWithReturn(ctx, Cmd, argtable, false); @@ -648,8 +648,11 @@ int CmdTraceList(const char *Cmd) { str_lower(type); int diclen = 0; - char dictionary[FILE_PATH_SIZE] = {0}; - CLIParamStrToBuf(arg_get_str(ctx, 8), (uint8_t *)dictionary, sizeof(dictionary), &diclen); + char dictionary[FILE_PATH_SIZE + 2] = {0}; + if (CLIParamStrToBuf(arg_get_str(ctx, 8), (uint8_t *)dictionary, FILE_PATH_SIZE, &diclen)) { + PrintAndLogEx(FAILED, "Dictionary file name too long or invalid."); + diclen = 0; + } CLIParserFree(ctx);