From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2124) id A38F83858C53; Tue, 11 Apr 2023 13:54:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A38F83858C53 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Nick Clifton To: bfd-cvs@sourceware.org Subject: [binutils-gdb] Fix illegal memory access when disassembling corrupt NFP binaries. X-Act-Checkin: binutils-gdb X-Git-Author: Nick Clifton X-Git-Refname: refs/heads/master X-Git-Oldrev: 7594741ebc2700a36fb77acfc6515dbfca4ed0dc X-Git-Newrev: 37522c873e86dd4941b9cdf38116f31d447d2234 Message-Id: <20230411135459.A38F83858C53@sourceware.org> Date: Tue, 11 Apr 2023 13:54:59 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2023 13:54:59 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D37522c873e86= dd4941b9cdf38116f31d447d2234 commit 37522c873e86dd4941b9cdf38116f31d447d2234 Author: Nick Clifton Date: Tue Apr 11 14:54:26 2023 +0100 Fix illegal memory access when disassembling corrupt NFP binaries. =20 PR 30310 * nfp-dis.c (init_nfp6000_priv): Check that the output section exists. Diff: --- opcodes/ChangeLog | 6 ++++++ opcodes/nfp-dis.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index e8a224bc424..a25c20d2fb9 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,9 @@ +2023-04-11 Nick Clifton + + PR 30310 + * nfp-dis.c (init_nfp6000_priv): Check that the output section + exists. + 2023-03-15 Nick Clifton =20 PR 30231 diff --git a/opcodes/nfp-dis.c b/opcodes/nfp-dis.c index a3d394e44dc..975fa697c55 100644 --- a/opcodes/nfp-dis.c +++ b/opcodes/nfp-dis.c @@ -2676,7 +2676,9 @@ init_nfp6000_priv (nfp_priv_data * priv, struct disas= semble_info *dinfo) =20 memset (mecfg_orders, -1, sizeof (mecfg_orders)); =20 - if (!dinfo->section) + if (dinfo->section =3D=3D NULL + || dinfo->section->owner =3D=3D NULL + || elf_elfsections (dinfo->section->owner) =3D=3D NULL) /* No section info, will use default values. */ return true;