Prevent an illegal memory access via an out of range fixup pointer.
[deliverable/binutils-gdb.git] / bfd / coffgen.c
index ff445d2d032f5365833ba20a85f0b2f92f85c310..b9e48728a2c6b23e8d725fceb7c390783a3fca60 100644 (file)
@@ -835,7 +835,7 @@ coff_mangle_symbols (bfd *bfd_ptr)
          for (i = 0; i < s->u.syment.n_numaux; i++)
            {
              combined_entry_type *a = s + i + 1;
-
+             
              BFD_ASSERT (! a->is_sym);
              if (a->fix_tag)
                {
@@ -1547,7 +1547,9 @@ coff_pointerize_aux (bfd *abfd,
 
   if ((ISFCN (type) || ISTAG (n_sclass) || n_sclass == C_BLOCK
        || n_sclass == C_FCN)
-      && auxent->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.l > 0)
+      && auxent->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.l > 0
+      && auxent->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.l
+      < (long) obj_raw_syment_count (abfd))
     {
       auxent->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.p =
        table_base + auxent->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.l;
This page took 0.022756 seconds and 4 git commands to generate.