View | Details | Raw Unified
Collapse All | Expand All

(-) src.orig/gdb/ChangeLog (+7 lines)
 Lines 1-3    Link Here 
2006-08-22  Will Drewry <wad@google.com>
	    Tavis Ormandy <taviso@google.com>
	* dwarf2read.c (decode_locdesc): Enforce location description stack
	boundaries.
	* dwarfread.c (locval): Likewise.
2006-08-19  Daniel Jacobowitz  <dan@codesourcery.com>
2006-08-19  Daniel Jacobowitz  <dan@codesourcery.com>
	* Makefile.in (amd64_linux_tdep_h): New.
	* Makefile.in (amd64_linux_tdep_h): New.
(-) src.orig/gdb/dwarf2read.c (-3 / +12 lines)
 Lines 8754-8761   dwarf2_fundamental_type (struct objfile Link Here 
   callers will only want a very basic result and this can become a
   callers will only want a very basic result and this can become a
   complaint.
   complaint.
   Note that stack[0] is unused except as a default error return.
   Note that stack[0] is unused except as a default error return. */
   Note that stack overflow is not yet handled.  */
static CORE_ADDR
static CORE_ADDR
decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu)
decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu)
 Lines 8772-8778   decode_locdesc (struct dwarf_block *blk, Link Here 
  i = 0;
  i = 0;
  stacki = 0;
  stacki = 0;
  stack[stacki] = 0;
  stack[++stacki] = 0;
  while (i < size)
  while (i < size)
    {
    {
 Lines 8951-8956   decode_locdesc (struct dwarf_block *blk, Link Here 
		     dwarf_stack_op_name (op));
		     dwarf_stack_op_name (op));
	  return (stack[stacki]);
	  return (stack[stacki]);
	}
	}
      /* Enforce maximum stack depth of size-1 to avoid ++stacki writing
         outside of the allocated space. Also enforce minimum > 0.
         -- wad@google.com 14 Aug 2006 */
      if (stacki >= sizeof (stack) / sizeof (*stack) - 1)
	internal_error (__FILE__, __LINE__,
	                _("location description stack too deep: %d"),
	                stacki);
      if (stacki <= 0)
	internal_error (__FILE__, __LINE__,
	                _("location description stack too shallow"));
    }
    }
  return (stack[stacki]);
  return (stack[stacki]);
}
}
(-) src.orig/gdb/dwarfread.c (-4 / +12 lines)
 Lines 2138-2146   decode_line_numbers (char *linetable) Link Here 
   NOTES
   NOTES
   Note that stack[0] is unused except as a default error return.
   Note that stack[0] is unused except as a default error return. */
   Note that stack overflow is not yet handled.
 */
static int
static int
locval (struct dieinfo *dip)
locval (struct dieinfo *dip)
 Lines 2160-2166   locval (struct dieinfo *dip) Link Here 
  loc += nbytes;
  loc += nbytes;
  end = loc + locsize;
  end = loc + locsize;
  stacki = 0;
  stacki = 0;
  stack[stacki] = 0;
  stack[++stacki] = 0;
  dip->isreg = 0;
  dip->isreg = 0;
  dip->offreg = 0;
  dip->offreg = 0;
  dip->optimized_out = 1;
  dip->optimized_out = 1;
 Lines 2224-2229   locval (struct dieinfo *dip) Link Here 
	  stacki--;
	  stacki--;
	  break;
	  break;
	}
	}
      /* Enforce maximum stack depth of size-1 to avoid ++stacki writing
         outside of the allocated space. Also enforce minimum > 0.
         -- wad@google.com 14 Aug 2006 */
      if (stacki >= sizeof (stack) / sizeof (*stack) - 1)
	internal_error (__FILE__, __LINE__,
	                _("location description stack too deep: %d"),
	                stacki);
      if (stacki <= 0)
	internal_error (__FILE__, __LINE__,
	                _("location description stack too shallow"));
    }
    }
  return (stack[stacki]);
  return (stack[stacki]);
}
}