mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-19 13:48:16 +08:00
client/comms.c: fix buffer overflow
Don't copy more bytes into pm3_capabilities as its size. Fix: RfidResearchGroup/proxmark3#189
This commit is contained in:
parent
107b3873fb
commit
0119e13ff3
1 changed files with 1 additions and 1 deletions
|
@ -613,7 +613,7 @@ int TestProxmark(void) {
|
||||||
|
|
||||||
SendCommandNG(CMD_CAPABILITIES, NULL, 0);
|
SendCommandNG(CMD_CAPABILITIES, NULL, 0);
|
||||||
if (WaitForResponseTimeoutW(CMD_CAPABILITIES, &resp, 1000, false)) {
|
if (WaitForResponseTimeoutW(CMD_CAPABILITIES, &resp, 1000, false)) {
|
||||||
memcpy(&pm3_capabilities, resp.data.asBytes, resp.length);
|
memcpy(&pm3_capabilities, resp.data.asBytes, MIN(sizeof(capabilities_t), resp.length));
|
||||||
conn.send_via_fpc_usart = pm3_capabilities.via_fpc;
|
conn.send_via_fpc_usart = pm3_capabilities.via_fpc;
|
||||||
conn.uart_speed = pm3_capabilities.baudrate;
|
conn.uart_speed = pm3_capabilities.baudrate;
|
||||||
PrintAndLogEx(INFO, "Communicating with PM3 over %s", conn.send_via_fpc_usart ? _YELLOW_("FPC UART") : _YELLOW_("USB-CDC"));
|
PrintAndLogEx(INFO, "Communicating with PM3 over %s", conn.send_via_fpc_usart ? _YELLOW_("FPC UART") : _YELLOW_("USB-CDC"));
|
||||||
|
|
Loading…
Reference in a new issue