From 151f5de4a6548cd83a79b4705f1e901776ddacc5 Mon Sep 17 00:00:00 2001
From: Nick Clifton <nickc@redhat.com>
Date: Thu, 28 May 2020 11:04:27 +0100
Subject: [PATCH] Fix a potential use of an uninitialised value in the ns32k
 disassembler.

	* ns32k-dis.c (print_insn_ns32k): Change the arg_bufs array to
	static.
---
 opcodes/ns32k-dis.c | 5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/opcodes/ns32k-dis.c b/opcodes/ns32k-dis.c
index 12df182..ccad820 100644
--- a/opcodes/ns32k-dis.c
+++ b/opcodes/ns32k-dis.c
@@ -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;
-- 
1.8.3.1