From a42580317ccebb169d7f07472315c6e5441ef437 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Fri, 27 Apr 2018 16:45:49 +0200 Subject: [PATCH] chg: 'trace list' - getfrombigbuf has now timeout --- client/cmdtrace.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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; + } } }