]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gprof/symtab.c
Fix an illegal memorty access when running gprof over corrupt data.
[thirdparty/binutils-gdb.git] / gprof / symtab.c
index ea47aac47b5577c7cde9ae4386eef63118f26dfd..61feebc5d029ec959e898310c86816ca123d20b1 100644 (file)
@@ -147,7 +147,7 @@ symtab_finalize (Sym_Table *tab)
        }
     }
 
-  if (tab->len > 0 && dst[-1].end_addr == 0)
+  if (tab->len > 0 && dst > tab->base && dst[-1].end_addr == 0)
     dst[-1].end_addr
       = core_text_sect->vma + bfd_section_size (core_text_sect) - 1;