From 89554501bb13af815d74f383b3c4c7ad61b57627 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Sun, 2 Jan 2022 00:13:20 +0100 Subject: [PATCH] trace list: check protocol exists and allows to run without arg --- client/src/cmdtrace.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/src/cmdtrace.c b/client/src/cmdtrace.c index dca4920ec..75b3eff50 100644 --- a/client/src/cmdtrace.c +++ b/client/src/cmdtrace.c @@ -729,7 +729,7 @@ int CmdTraceList(const char *Cmd) { arg_str0(NULL, "dict", "", "use dictionary keys file"), arg_param_end }; - CLIExecWithReturn(ctx, Cmd, argtable, false); + CLIExecWithReturn(ctx, Cmd, argtable, true); bool use_buffer = arg_get_lit(ctx, 1); bool show_wait_cycles = arg_get_lit(ctx, 2); @@ -775,6 +775,11 @@ int CmdTraceList(const char *Cmd) { else if (strcmp(type, "lto") == 0) protocol = LTO; else if (strcmp(type, "cryptorf") == 0) protocol = PROTO_CRYPTORF; else if (strcmp(type, "raw") == 0) protocol = -1; + else if (strcmp(type, "") == 0) protocol = -1; + else { + PrintAndLogEx(FAILED, "Unknown protocol \"%s\"", type); + return PM3_EINVARG; + } if (use_buffer == false) { download_trace();