]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libdwfl: dwfl_module_getdwarf.c don't use symtab with bogus sh_entsize.
authorMark Wielaard <mjw@redhat.com>
Fri, 14 Nov 2014 11:38:12 +0000 (12:38 +0100)
committerMark Wielaard <mjw@redhat.com>
Fri, 14 Nov 2014 11:38:12 +0000 (12:38 +0100)
Signed-off-by: Mark Wielaard <mjw@redhat.com>
libdwfl/ChangeLog
libdwfl/dwfl_module_getdwarf.c

index 78314c4a3a607463e850f106f412f51ebfa4d67a..22bc783d6fd190216445301f5fe4255ad0477d5c 100644 (file)
@@ -1,3 +1,8 @@
+2014-11-14  Mark Wielaard  <mjw@redhat.com>
+
+       * dwfl_module_getdwarf.c (load_symtab): Don't use tables which have
+       a zero sh_entsize.
+
 2014-11-10  Mark Wielaard  <mjw@redhat.com>
 
        * dwfl_module_getdwarf.c (find_dynsym): New inner function
index adb94b4c591092a5c7e0ffe41b7f703ac02f974c..a20875b532c8a6ec15bd0097f0afb9834f663d4e 100644 (file)
@@ -575,6 +575,8 @@ load_symtab (struct dwfl_file *file, struct dwfl_file **symfile,
        switch (shdr->sh_type)
          {
          case SHT_SYMTAB:
+           if (shdr->sh_entsize == 0)
+             break;
            symtab = true;
            *symscn = scn;
            *symfile = file;
@@ -589,6 +591,8 @@ load_symtab (struct dwfl_file *file, struct dwfl_file **symfile,
            if (symtab)
              break;
            /* Use this if need be, but keep looking for SHT_SYMTAB.  */
+           if (shdr->sh_entsize == 0)
+             break;
            *symscn = scn;
            *symfile = file;
            *strshndx = shdr->sh_link;