PR24402, global buffer overflow in symtab_finalize
authorAlan Modra <amodra@gmail.com>
Mon, 1 Apr 2019 01:30:09 +0000 (12:00 +1030)
committerAlan Modra <amodra@gmail.com>
Mon, 1 Apr 2019 03:05:15 +0000 (13:35 +1030)
PR 24402
* symtab.c (symtab_finalize): Init prev_addr to one less than
first symbol address, not one more.  Correct test for symbols
with leading underscores.

gprof/ChangeLog
gprof/symtab.c

index a1da7e5ad8a5efc94579d64c4f8e85d01fe37098..9815b156127871ad76fd30275fedc3311b1c075e 100644 (file)
@@ -1,3 +1,10 @@
+2019-04-01  Alan Modra  <amodra@gmail.com>
+
+       PR 24402
+       * symtab.c (symtab_finalize): Init prev_addr to one less than
+       first symbol address, not one more.  Correct test for symbols
+       with leading underscores.
+
 2019-01-21  Nick Clifton  <nickc@redhat.com>
 
        * po/tr.po: Updated Turkish translation.
index 740168c703b3f26e114f51de5d3de39a8d20add0..70eb41573bca55a693056d98a6d6c1e01a2588b2 100644 (file)
@@ -89,7 +89,7 @@ symtab_finalize (Sym_Table *tab)
 
   /* Remove duplicate entries to speed-up later processing and
      set end_addr if its not set yet.  */
-  prev_addr = tab->base[0].addr + 1;
+  prev_addr = tab->base[0].addr - 1;
 
   for (src = dst = tab->base; src < tab->limit; ++src)
     {
@@ -107,7 +107,7 @@ symtab_finalize (Sym_Table *tab)
                  && ((src->is_func && !dst[-1].is_func)
                      || ((src->is_func == dst[-1].is_func)
                          && ((src->name[0] != '_' && dst[-1].name[0] == '_')
-                             || (src->name[0]
+                             || (src->name[0] == '_' && dst[-1].name[0] == '_'
                                  && src->name[1] != '_'
                                  && dst[-1].name[1] == '_'))))))
            {
This page took 0.025227 seconds and 4 git commands to generate.