public inbox for rda@sourceware.org
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: rda@sources.redhat.com
Subject: [PATCH] Fix gdbserv_reg --> little endian buffer copying problem
Date: Tue, 20 May 2003 21:19:00 -0000	[thread overview]
Message-ID: <1030520211848.ZM23476@localhost.localdomain> (raw)

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

                 reply	other threads:[~2003-05-20 21:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1030520211848.ZM23476@localhost.localdomain \
    --to=kevinb@redhat.com \
    --cc=rda@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).