This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[OB] fix array size in sh-dis.c
- From: Michael Snyder <msnyder at redhat dot com>
- To: Joern Rennecke <joern dot rennecke at superh dot com>
- Cc: amylaar at fairadsl dot co dot uk, andrew dot stubbs at superh dot com, gdb-patches at sources dot redhat dot com, Elena Zannoni <ezannoni at redhat dot com>
- Date: Tue, 13 Jan 2004 11:59:51 -0800
- Subject: [OB] fix array size in sh-dis.c
- Organization: Red Hat, Inc.
- References: <200401091319.i09DJ7511867@linsvr1.uk.superh.com>
This array needs to be four bytes, in case we have to
disassemble a four byte insn (eg. ppi). Otherwise, it
clobbers one of the nearby local variables.
2004-01-13 Michael Snyder <msnyder@redhat.com>
* sh-dis.c (print_insn_sh): Allocate 4 bytes for insn.
Index: sh-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/sh-dis.c,v
retrieving revision 1.17
diff -p -r1.17 sh-dis.c
*** sh-dis.c 5 Dec 2003 02:02:32 -0000 1.17
--- sh-dis.c 13 Jan 2004 19:56:21 -0000
*************** print_insn_sh (memaddr, info)
*** 397,403 ****
{
fprintf_ftype fprintf_fn = info->fprintf_func;
void *stream = info->stream;
! unsigned char insn[2];
unsigned char nibs[4];
int status;
bfd_vma relmask = ~(bfd_vma) 0;
--- 397,403 ----
{
fprintf_ftype fprintf_fn = info->fprintf_func;
void *stream = info->stream;
! unsigned char insn[4];
unsigned char nibs[4];
int status;
bfd_vma relmask = ~(bfd_vma) 0;