From ac38308c9515c590cf3e80d10259bdcb4eef135f Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Thu, 26 Jul 2007 19:06:12 +0000 Subject: [PATCH] 2007-07-26 Michael Snyder * coffgen.c (fixup_symbol_value): Guard against null; bfd_is_com_section will dereference the section pointer. --- bfd/ChangeLog | 3 +++ bfd/coffgen.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 9a2ce289c2a..b51de1fcc9c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,8 @@ 2007-07-26 Michael Snyder + * coffgen.c (fixup_symbol_value): Guard against null; + bfd_is_com_section will dereference the section pointer. + * syms.c (bfd_decode_symclass): Guard against NULL, since bfd_is_com_section dereferences the pointer. diff --git a/bfd/coffgen.c b/bfd/coffgen.c index 7fad78c78f3..694625fa0a8 100644 --- a/bfd/coffgen.c +++ b/bfd/coffgen.c @@ -567,7 +567,8 @@ fixup_symbol_value (bfd *abfd, struct internal_syment *syment) { /* Normalize the symbol flags. */ - if (bfd_is_com_section (coff_symbol_ptr->symbol.section)) + if (coff_symbol_ptr->symbol.section + && bfd_is_com_section (coff_symbol_ptr->symbol.section)) { /* A common symbol is undefined with a value. */ syment->n_scnum = N_UNDEF; -- 2.30.2