This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Fix error check in remote_read_bytes
- From: Mark Salter <msalter at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Tue, 23 Jul 2002 11:10:34 -0400
- Subject: Fix error check in remote_read_bytes
2002-07-23 Mark Salter <msalter@redhat.com>
* remote.c (remote_read_bytes): Fix check for error.
Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.88
diff -u -p -5 -r1.88 remote.c
--- remote.c 11 Jul 2002 13:50:49 -0000 1.88
+++ remote.c 23 Jul 2002 15:10:11 -0000
@@ -3951,11 +3951,13 @@ remote_read_bytes (CORE_ADDR memaddr, ch
*p = '\0';
putpkt (buf);
getpkt (buf, sizeof_buf, 0);
- if (buf[0] == 'E')
+ if (buf[0] == 'E'
+ && isxdigit (buf[1]) && isxdigit (buf[2])
+ && buf[3] == '\0')
{
/* There is no correspondance between what the remote protocol uses
for errors and errno codes. We would like a cleaner way of
representing errors (big enough to include errno codes, bfd_error
codes, and others). But for now just return EIO. */