This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[COMMITTED] libdwelf: Check the d_buf actually exists in dwelf_elf_gnu_debuglink.


Signed-off-by: Mark Wielaard <mjw@redhat.com>
---
 libdwelf/ChangeLog                 | 5 +++++
 libdwelf/dwelf_elf_gnu_debuglink.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/libdwelf/ChangeLog b/libdwelf/ChangeLog
index 9f95ea8..342cb9c 100644
--- a/libdwelf/ChangeLog
+++ b/libdwelf/ChangeLog
@@ -1,3 +1,8 @@
+2014-11-14  Mark Wielaard  <mjw@redhat.com>
+
+	* dwelf_elf_gnu_debuglink.c (dwelf_elf_gnu_debuglink): Check d_buf
+	is not NULL.
+
 2014-04-30  Mark Wielaard  <mjw@redhat.com>
 
 	* Makefile.am (AM_CPPFLAGS): Add libdwfl and libebl include dirs.
diff --git a/libdwelf/dwelf_elf_gnu_debuglink.c b/libdwelf/dwelf_elf_gnu_debuglink.c
index 7b5fc93..6e22cf6 100644
--- a/libdwelf/dwelf_elf_gnu_debuglink.c
+++ b/libdwelf/dwelf_elf_gnu_debuglink.c
@@ -60,7 +60,7 @@ dwelf_elf_gnu_debuglink (Elf *elf, GElf_Word *crc)
 
   /* Found the .gnu_debuglink section.  Extract its contents.  */
   Elf_Data *rawdata = elf_rawdata (scn, NULL);
-  if (rawdata == NULL)
+  if (rawdata == NULL || rawdata->d_buf == NULL)
     return NULL;
 
   /* The CRC comes after the zero-terminated file name,
-- 
1.8.3.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]