This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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 use of uninitialized value in linux-arm-low in GDBServer.


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


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