Skip to content

Commit 9c60b33

Browse files
committed
gdb_main: Restore m-packet request-length check
* Its purpose is to ensure that potential responses fit into RSP packet buffer * Suppresses unexpected E02 responses on reading small SRAM/Flash variables * Still enforces E02 to 513 byte read requests or larger
1 parent 74fd17d commit 9c60b33

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/gdb_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ int32_t gdb_main_loop(target_controller_s *const tc, const gdb_packet_s *const p
145145
uint32_t addr, len;
146146
ERROR_IF_NO_TARGET();
147147
if (read_hex32(packet->data + 1, &rest, &addr, ',') && read_hex32(rest, NULL, &len, READ_HEX_NO_FOLLOW)) {
148-
if (len > packet->size / 2U) {
148+
if (len > GDB_PACKET_BUFFER_SIZE / 2U) {
149149
gdb_put_packet_error(2U);
150150
break;
151151
}

0 commit comments

Comments
 (0)