This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]