diff --git a/client/cmdtrace.c b/client/cmdtrace.c index 5c47b7dc2..a4ee409b8 100644 --- a/client/cmdtrace.c +++ b/client/cmdtrace.c @@ -485,7 +485,7 @@ int CmdTraceList(const char *Cmd) { } if ( isOnline ) { - // Query for the size of the trace + // Query for the size of the trace, downloading USB_CMD_DATA_SIZE UsbCommand response; GetFromBigBuf(trace, USB_CMD_DATA_SIZE, 0); if ( !WaitForResponseTimeout(CMD_ACK, &response, 4000) ) { @@ -503,7 +503,11 @@ int CmdTraceList(const char *Cmd) { } trace = p; GetFromBigBuf(trace, traceLen, 0); - WaitForResponse(CMD_ACK, NULL); + if ( !WaitForResponseTimeout(CMD_ACK, NULL, 2500) ) { + PrintAndLogEx(WARNING, "command execution time out"); + free(trace); + return 3; + } } }