This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA] fencepost error in linux-low.c
- From: Michael Snyder <msnyder at vmware dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, Pedro Alves <pedro at codesourcery dot com>
- Date: Sat, 26 Feb 2011 14:40:34 -0800
- Subject: [RFA] fencepost error in linux-low.c
Hey Pedro,
Again, pretty sure this should be greater or equal.
Otherwise, the memcpy has a chance of overflowing the buffer.
Thanks,
Michael
2011-02-26 Michael Snyder <msnyder@vmware.com>
* linux-low.c (linux_xfer_siginfo): Fix fencepost error.
Index: linux-low.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/linux-low.c,v
retrieving revision 1.168
diff -u -p -u -p -r1.168 linux-low.c
--- linux-low.c 6 Jan 2011 00:14:09 -0000 1.168
+++ linux-low.c 26 Feb 2011 22:38:14 -0000
@@ -4728,7 +4728,7 @@ linux_xfer_siginfo (const char *annex, u
readbuf != NULL ? "Reading" : "Writing",
pid);
- if (offset > sizeof (siginfo))
+ if (offset >= sizeof (siginfo))
return -1;
if (ptrace (PTRACE_GETSIGINFO, pid, 0, &siginfo) != 0)