This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[ob] Fix a segfault on corrupted remote packets
- From: Daniel Jacobowitz <drow at false dot org>
- To: gdb-patches at sourceware dot org
- Date: Fri, 7 Apr 2006 12:17:38 -0400
- Subject: [ob] Fix a segfault on corrupted remote packets
There used to be four warnings about corrupted T packet responses in
remote.c. Three of them were converted to errors, because otherwise the
string parsing goes off into the weeds and GDB crashes, but this one was
missed; I actually encountered this with an under-development stub,
so I'm committing the obvious correction.
--
Daniel Jacobowitz
CodeSourcery
2006-04-07 Daniel Jacobowitz <dan@codesourcery.com>
* remote.c (remote_wait): Convert warning to error before
parsing corrupt packets.
Index: gdb/remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.205
diff -u -p -r1.205 remote.c
--- gdb/remote.c 30 Mar 2006 16:56:30 -0000 1.205
+++ gdb/remote.c 7 Apr 2006 16:14:48 -0000
@@ -2741,9 +2741,9 @@ remote_wait (ptid_t ptid, struct target_
{
p1 = strchr (p, ':');
if (p1 == NULL)
- warning (_("Malformed packet(a) (missing colon): %s\n\
+ error (_("Malformed packet(a) (missing colon): %s\n\
Packet: '%s'\n"),
- p, buf);
+ p, buf);
if (strncmp (p, "thread", p1 - p) == 0)
{
p_temp = unpack_varlen_hex (++p1, &thread_num);