Merge pull request #190 from uhei/memcpy-bo

client/comms.c: fix buffer overflow
This commit is contained in:
Philippe Teuwen 2019-05-10 18:47:39 +02:00 committed by GitHub
commit 5aed3e04c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -613,7 +613,7 @@ int TestProxmark(void) {
SendCommandNG(CMD_CAPABILITIES, NULL, 0);
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.uart_speed = pm3_capabilities.baudrate;
PrintAndLogEx(INFO, "Communicating with PM3 over %s", conn.send_via_fpc_usart ? _YELLOW_("FPC UART") : _YELLOW_("USB-CDC"));