mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-14 02:26:59 -07:00
rework of GetFromBigBuf() (#597)
* this should fix crashes reported in issue #497 * don't allow receiver thread to write directly into arbitrary main thread's memory * instead use cmdBuffer[] for CMD_DOWNLOADED_RAW_ADC_SAMPLES_125K as well * add timeout and warning options to GetFromBigBuf(), same as in WaitForResponseTimeoutW() * move GetFromBigBuf() from data.c to comms.c * remove data.c and data.h
This commit is contained in:
parent
03cdcca03f
commit
babca445ff
27 changed files with 87 additions and 116 deletions
|
@ -14,7 +14,6 @@
|
|||
#include <string.h>
|
||||
#include "proxmark3.h"
|
||||
#include "util.h"
|
||||
#include "data.h"
|
||||
#include "ui.h"
|
||||
#include "iso14443crc.h"
|
||||
#include "parity.h"
|
||||
|
@ -497,8 +496,7 @@ int CmdHFList(const char *Cmd)
|
|||
trace = malloc(USB_CMD_DATA_SIZE);
|
||||
// Query for the size of the trace
|
||||
UsbCommand response;
|
||||
GetFromBigBuf(trace, USB_CMD_DATA_SIZE, 0);
|
||||
WaitForResponse(CMD_ACK, &response);
|
||||
GetFromBigBuf(trace, USB_CMD_DATA_SIZE, 0, &response, -1, false);
|
||||
traceLen = response.arg[2];
|
||||
if (traceLen > USB_CMD_DATA_SIZE) {
|
||||
uint8_t *p = realloc(trace, traceLen);
|
||||
|
@ -508,8 +506,7 @@ int CmdHFList(const char *Cmd)
|
|||
return 2;
|
||||
}
|
||||
trace = p;
|
||||
GetFromBigBuf(trace, traceLen, 0);
|
||||
WaitForResponse(CMD_ACK, NULL);
|
||||
GetFromBigBuf(trace, traceLen, 0, NULL, -1, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue