]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libdwelf: Check the d_buf actually exists in dwelf_elf_gnu_debuglink.
authorMark Wielaard <mjw@redhat.com>
Fri, 14 Nov 2014 15:58:36 +0000 (16:58 +0100)
committerMark Wielaard <mjw@redhat.com>
Fri, 14 Nov 2014 15:58:36 +0000 (16:58 +0100)
Signed-off-by: Mark Wielaard <mjw@redhat.com>
libdwelf/ChangeLog
libdwelf/dwelf_elf_gnu_debuglink.c

index 9f95ea81c1bda4f3dbb554c8cf8ebd1ff240a028..342cb9cfe12727fc30459c53b6d807be33ba1c2d 100644 (file)
@@ -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.
index 7b5fc93c72d27748f65bae99141199a78f048606..6e22cf6796ef3a55ce10f18189aeec4eb0e5dbe8 100644 (file)
@@ -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,