This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
[COMMITTED] libdwelf: Check the d_buf actually exists in dwelf_elf_gnu_debuglink.
- From: Mark Wielaard <mjw at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Fri, 14 Nov 2014 17:01:09 +0100
- Subject: [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