diff --git a/common/interfaces/desktop_app_interface/usb_internals.c b/common/interfaces/desktop_app_interface/usb_internals.c index f3ead1a6b..a0dc62267 100644 --- a/common/interfaces/desktop_app_interface/usb_internals.c +++ b/common/interfaces/desktop_app_interface/usb_internals.c @@ -210,6 +210,12 @@ static comm_error_code_t comm_process_cmd_packet(const packet_t *rx_packet) { // Duplicate packets are ignored; Only packets in expected sequence are // appended to buffer comm_status.curr_cmd_chunk_no = rx_packet->header.chunk_number; + + if ((COMM_BUFFER_SIZE - comm_status.curr_cmd_received_length) < + rx_packet->header.payload_length) { + return INVALID_PAYLOAD_LENGTH; + } + memcpy(comm_io_buffer + comm_status.curr_cmd_received_length, rx_packet->payload, rx_packet->header.payload_length); diff --git a/version.txt b/version.txt index 2aba5c151..9f000c66a 100755 --- a/version.txt +++ b/version.txt @@ -1,3 +1,3 @@ -firmware version=000:006:003:000 +firmware version=000:006:003:001 hardware version=000:001:000:000 magic number=45227A01