public inbox for rda@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix gdbserv_reg --> little endian buffer copying problem
@ 2003-05-20 21:19 Kevin Buettner
  0 siblings, 0 replies; only message in thread
From: Kevin Buettner @ 2003-05-20 21:19 UTC (permalink / raw)
  To: rda

The patch below fixes a bug in which a value in a gdbserv_reg was not
being correctly copied to a (little endian) buffer.  The code worked
correctly unless the buffer to copy to was smaller than the length of
the data of the gdbserv_reg in question, in which case it would copy
the wrong bytes (and too many bytes).

Thanks to Chris Demetriou for finding this problem.

	* lib/gdbserv-utils.c (gdbserv_le_bytes_from_reg): Fix typo that
	caused incorrect number of bytes to be copied.

Index: lib/gdbserv-utils.c
===================================================================
RCS file: /cvs/src/src/rda/lib/gdbserv-utils.c,v
retrieving revision 1.2
diff -u -p -r1.2 gdbserv-utils.c
--- lib/gdbserv-utils.c	3 Dec 2002 03:22:08 -0000	1.2
+++ lib/gdbserv-utils.c	20 May 2003 21:07:42 -0000
@@ -336,7 +336,7 @@ gdbserv_le_bytes_from_reg (struct gdbser
 	      buflen - reg->len);
     }
 
-  reverse_copy_bytes (buf, reg->buf + regoffset, reg->len);
+  reverse_copy_bytes (buf, reg->buf + regoffset, len);
 }
 
 void

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-05-20 21:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-20 21:19 [PATCH] Fix gdbserv_reg --> little endian buffer copying problem Kevin Buettner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).