diff options
author | Nick Clifton <nickc@redhat.com> | 2021-04-29 17:55:43 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2021-04-29 17:55:43 +0100 |
commit | 09e40e44ad05822ed72f6ad720b5e75ea2a8fc67 (patch) | |
tree | 5a6c2619aaeb62334cea7aaa6c7bf0b05f140c5e /bfd/syms.c | |
parent | 063e75c9e4307d21b787a71b6d5b61a2560f5073 (diff) | |
download | gdb-09e40e44ad05822ed72f6ad720b5e75ea2a8fc67.zip gdb-09e40e44ad05822ed72f6ad720b5e75ea2a8fc67.tar.gz gdb-09e40e44ad05822ed72f6ad720b5e75ea2a8fc67.tar.bz2 |
Fix an access through a null pointer when parsing a corrupt SOM format fle.
PR 27793
* som.c (som_slurp_symbol_table): Assign symbols without any scope
to the undefined section.
(som_decode_symclass): Check for a missing symbol section.
* syms.c (bfd_decode_symclass): Likewise.
Diffstat (limited to 'bfd/syms.c')
-rw-r--r-- | bfd/syms.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -654,6 +654,10 @@ bfd_decode_symclass (asymbol *symbol) { char c; + /* Paranoia... */ + if (symbol == NULL || symbol->section == NULL) + return '?'; + if (symbol->section && bfd_is_com_section (symbol->section)) { if (symbol->section->flags & SEC_SMALL_DATA) |