From 21c3f183e0258bf4f48bb90cd6a95eb1f3e2a9f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 31 Mar 2020 15:12:27 +0200 Subject: [PATCH] winedbg: Force packet data to be NUL terminated. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: RĂ©mi Bernon Signed-off-by: Alexandre Julliard --- programs/winedbg/gdbproxy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/winedbg/gdbproxy.c b/programs/winedbg/gdbproxy.c index e2954c08ddd..fde6c556c26 100644 --- a/programs/winedbg/gdbproxy.c +++ b/programs/winedbg/gdbproxy.c @@ -1201,7 +1201,6 @@ static enum packet_return packet_read_memory(struct gdb_context* gdbctx) SIZE_T r = 0; assert(gdbctx->in_trap); - /* FIXME:check in_packet_len for reading %p,%x */ if (sscanf(gdbctx->in_packet, "%p,%x", &addr, &len) != 2) return packet_error; if (len <= 0) return packet_error; TRACE("Read %u bytes at %p\n", len, addr); @@ -1794,6 +1793,7 @@ static BOOL extract_packets(struct gdb_context* gdbctx) { gdbctx->in_packet = gdbctx->in_buf + 2; gdbctx->in_packet_len = plen - 1; + gdbctx->in_packet[gdbctx->in_packet_len] = '\0'; ret = (packet_entries[i].handler)(gdbctx); } switch (ret & ~packet_last_f)