summaryrefslogtreecommitdiff
path: root/libebl
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2014-11-17 23:15:45 +0100
committerMark Wielaard <mjw@redhat.com>2014-11-17 23:19:03 +0100
commit5c1a45c2d370e7fd1149fa74a9382e202fbfe8fe (patch)
treeb41fc506962bb78a5b9176600abd968146bc7e2b /libebl
parent7df0da33f4789e264242a4cb8af30c0aefe6d6b4 (diff)
downloadelfutils-5c1a45c2d370e7fd1149fa74a9382e202fbfe8fe.tar.gz
Check elf_strptr didn't fail getting section name.
Since elf_strptr can fail and return NULL we should always check the result before usage. Debug sections are only handled by section name, so make sure the name actually exists. Signed-off-by: Mark Wielaard <mjw@redhat.com>
Diffstat (limited to 'libebl')
-rw-r--r--libebl/ChangeLog4
-rw-r--r--libebl/ebldebugscnp.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/libebl/ChangeLog b/libebl/ChangeLog
index 5ec71016..b6a0e632 100644
--- a/libebl/ChangeLog
+++ b/libebl/ChangeLog
@@ -1,3 +1,7 @@
+2014-11-17 Mark Wielaard <mjw@redhat.com>
+
+ * ebldebugscnp.c (ebl_debugscn_p): Check name is not NULL.
+
2014-06-17 Mark Wielaard <mjw@redhat.com>
* eblinitreg.c (ebl_func_addr_mask): New function.
diff --git a/libebl/ebldebugscnp.c b/libebl/ebldebugscnp.c
index f2351e23..01a56754 100644
--- a/libebl/ebldebugscnp.c
+++ b/libebl/ebldebugscnp.c
@@ -1,5 +1,5 @@
/* Check section name for being that of a debug informatino section.
- Copyright (C) 2002 Red Hat, Inc.
+ Copyright (C) 2002, 2014 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -40,5 +40,5 @@ ebl_debugscn_p (ebl, name)
Ebl *ebl;
const char *name;
{
- return ebl->debugscn_p (name);
+ return name != NULL && ebl->debugscn_p (name);
}