From 810ed4db984d378ca9c8e3d152966fb81c23ef95 Mon Sep 17 00:00:00 2001 From: Christophe Guillon Date: Tue, 15 May 2018 12:27:45 +0000 Subject: [PATCH] Fix uninitialised memory acccess in COFF bfd backend 2018-05-15 Christophe Guillon * coffcode.h (coff_bigobj_swap_aux_in): Make sure that all fields of the aux structure are initialised. Change-Id: I81be255ac6611afbe00995fac550e98e6a07e5df --- bfd/ChangeLog | 5 +++++ bfd/coffcode.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 6e97ff2..655c0ad 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2018-05-15 Christophe Guillon + + * coffcode.h (coff_bigobj_swap_aux_in): Make sure that all fields + of the aux structure are initialised. + 2018-05-15 Francois H. Theron * targets.c: Wrap nfp_elf64_vec in BFD64 ifdef. diff --git a/bfd/coffcode.h b/bfd/coffcode.h index c63ebd2..6ad991c 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -5528,6 +5528,9 @@ coff_bigobj_swap_aux_in (bfd *abfd, AUXENT_BIGOBJ *ext = (AUXENT_BIGOBJ *) ext1; union internal_auxent *in = (union internal_auxent *) in1; + /* Make sure that all fields in the aux structure are + initialised. */ + memset (in, 0, sizeof * in); switch (in_class) { case C_FILE: -- 2.7.4