Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Antoine Tremblay <antoine.tremblay@ericsson.com>
To: <gdb-patches@sourceware.org>
Cc: Antoine Tremblay <antoine.tremblay@ericsson.com>
Subject: [PATCH] Fix use of uninitialized value in linux-arm-low in GDBServer.
Date: Thu, 24 Sep 2015 17:30:00 -0000	[thread overview]
Message-ID: <1443115845-3044-1-git-send-email-antoine.tremblay@ericsson.com> (raw)

In arm_breakpoint_at, an uninitialized unsigned long was used were only
4 bytes would be written to the variable thus polluting the value on 64bit.

This patch changes the value to an unsigned int.

gdb/gdbserver/ChangeLog:
	* linux-arm-low.c (arm_breakpoint_at): Fix insn size.
---
 gdb/gdbserver/linux-arm-low.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/gdbserver/linux-arm-low.c b/gdb/gdbserver/linux-arm-low.c
index a277bb6..b594e57 100644
--- a/gdb/gdbserver/linux-arm-low.c
+++ b/gdb/gdbserver/linux-arm-low.c
@@ -272,7 +272,7 @@ arm_breakpoint_at (CORE_ADDR where)
   else
     {
       /* ARM mode.  */
-      unsigned long insn;
+      unsigned int insn;
 
       (*the_target->read_memory) (where, (unsigned char *) &insn, 4);
       if (insn == arm_breakpoint)
-- 
1.9.1


             reply	other threads:[~2015-09-24 17:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-24 17:30 Antoine Tremblay [this message]
2015-09-25 11:10 ` Yao Qi
2015-09-25 11:33   ` Antoine Tremblay
2015-09-25 11:42     ` Antoine Tremblay
2015-09-29 14:05       ` Pedro Alves

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=1443115845-3044-1-git-send-email-antoine.tremblay@ericsson.com \
    --to=antoine.tremblay@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    /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