From 4c228b6c64efe7855dfe6648c65f8b796c26b9c9 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Mon, 19 Apr 2021 14:22:15 +0200 Subject: [PATCH] fix handling of trace list -1 with empty trace buffer --- client/src/cmdtrace.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/src/cmdtrace.c b/client/src/cmdtrace.c index ba1987502..36314feb9 100644 --- a/client/src/cmdtrace.c +++ b/client/src/cmdtrace.c @@ -678,8 +678,11 @@ int CmdTraceList(const char *Cmd) { else if (strcmp(type, "cryptorf") == 0) protocol = PROTO_CRYPTORF; else if (strcmp(type, "raw") == 0) protocol = -1; - if (use_buffer == false || (g_traceLen == 0)) { + if (use_buffer == false) { download_trace(); + } else if (g_traceLen == 0) { + PrintAndLogEx(FAILED, "You requested a trace list in offline mode but there is no trace, consider using 'trace load' or removing parameter '1'"); + return PM3_EINVARG; } PrintAndLogEx(SUCCESS, "Recorded activity (trace len = " _YELLOW_("%lu") " bytes)", g_traceLen);