This is the mail archive of the rda@sources.redhat.com mailing list for the rda 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]

[PATCH] Fix gdbserv_reg --> little endian buffer copying problem


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


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