]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix a potential use of an uninitialised value in the ns32k disassembler.
authorNick Clifton <nickc@redhat.com>
Thu, 28 May 2020 10:04:27 +0000 (11:04 +0100)
committerNick Clifton <nickc@redhat.com>
Thu, 28 May 2020 10:04:27 +0000 (11:04 +0100)
* ns32k-dis.c (print_insn_ns32k): Change the arg_bufs array to
static.

opcodes/ChangeLog
opcodes/ns32k-dis.c

index 52cbe8e7ae5df195b51253212f46a0afee004e79..01892090697ae99e9bbcc431590fe1c202a63020 100644 (file)
@@ -1,3 +1,8 @@
+2020-05-28  Nick Clifton  <nickc@redhat.com>
+
+       * ns32k-dis.c (print_insn_ns32k): Change the arg_bufs array to
+       static.
+
 2020-05-26  Sandra Loosemore  <sandra@codesourcery.com>
 
        Fix extraction of signed constants in nios2 disassembler (again).
index 12df182d0a442bec0f222741126739130f7dd4c1..ccad820d8f3366eb3864e3fb43ca639fd86ebc03 100644 (file)
@@ -738,7 +738,10 @@ print_insn_ns32k (bfd_vma memaddr, disassemble_info *info)
   unsigned short first_word;
   int ioffset;         /* Bits into instruction.  */
   int aoffset;         /* Bits into arguments.  */
-  char arg_bufs[MAX_ARGS+1][ARG_LEN];
+  /* The arg_bufs array is made static in order to avoid a potential
+     use of an uninitialised value if we are asekd to disassemble a
+     corrupt instruction.  */
+  static char arg_bufs[MAX_ARGS+1][ARG_LEN];
   int argnum;
   int maxarg;
   struct private priv;