From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16545 invoked by alias); 20 May 2003 21:19:29 -0000 Mailing-List: contact rda-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: rda-owner@sources.redhat.com Received: (qmail 15024 invoked from network); 20 May 2003 21:18:55 -0000 Date: Tue, 20 May 2003 21:19:00 -0000 From: Kevin Buettner Message-Id: <1030520211848.ZM23476@localhost.localdomain> X-Mailer: Z-Mail (4.0.1 13Jan97 Caldera) To: rda@sources.redhat.com Subject: [PATCH] Fix gdbserv_reg --> little endian buffer copying problem MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-q2/txt/msg00004.txt.bz2 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