aboutsummaryrefslogtreecommitdiff
path: root/bfd/section.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/section.c')
-rw-r--r--bfd/section.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/bfd/section.c b/bfd/section.c
index a353488..6b6aa92 100644
--- a/bfd/section.c
+++ b/bfd/section.c
@@ -898,6 +898,9 @@ bfd_get_section_by_name (bfd *abfd, const char *name)
{
struct section_hash_entry *sh;
+ if (name == NULL)
+ return NULL;
+
sh = section_hash_lookup (&abfd->section_htab, name, false, false);
if (sh != NULL)
return &sh->section;
@@ -1006,6 +1009,9 @@ bfd_get_section_by_name_if (bfd *abfd, const char *name,
struct section_hash_entry *sh;
unsigned long hash;
+ if (name == NULL)
+ return NULL;
+
sh = section_hash_lookup (&abfd->section_htab, name, false, false);
if (sh == NULL)
return NULL;