This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Fix use of uninitialized value in linux-arm-low in GDBServer.
- From: Antoine Tremblay <antoine dot tremblay at ericsson dot com>
- To: <gdb-patches at sourceware dot org>
- Cc: Antoine Tremblay <antoine dot tremblay at ericsson dot com>
- Date: Thu, 24 Sep 2015 13:30:45 -0400
- Subject: [PATCH] Fix use of uninitialized value in linux-arm-low in GDBServer.
- Authentication-results: sourceware.org; auth=none
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