Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 144833
Collapse All | Expand All

(-)src.orig/gdb/ChangeLog (+7 lines)
Lines 1-3 Link Here
1
2006-08-22  Will Drewry <wad@google.com>
2
	    Tavis Ormandy <taviso@google.com>
3
4
	* dwarf2read.c (decode_locdesc): Enforce location description stack
5
	boundaries.
6
	* dwarfread.c (locval): Likewise.
7
1
2006-08-19  Daniel Jacobowitz  <dan@codesourcery.com>
8
2006-08-19  Daniel Jacobowitz  <dan@codesourcery.com>
2
9
3
	* Makefile.in (amd64_linux_tdep_h): New.
10
	* 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
8754
   callers will only want a very basic result and this can become a
8754
   callers will only want a very basic result and this can become a
8755
   complaint.
8755
   complaint.
8756
8756
8757
   Note that stack[0] is unused except as a default error return.
8757
   Note that stack[0] is unused except as a default error return. */
8758
   Note that stack overflow is not yet handled.  */
8759
8758
8760
static CORE_ADDR
8759
static CORE_ADDR
8761
decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu)
8760
decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu)
Lines 8772-8778 decode_locdesc (struct dwarf_block *blk, Link Here
8772
8771
8773
  i = 0;
8772
  i = 0;
8774
  stacki = 0;
8773
  stacki = 0;
8775
  stack[stacki] = 0;
8774
  stack[++stacki] = 0;
8776
8775
8777
  while (i < size)
8776
  while (i < size)
8778
    {
8777
    {
Lines 8951-8956 decode_locdesc (struct dwarf_block *blk, Link Here
8951
		     dwarf_stack_op_name (op));
8950
		     dwarf_stack_op_name (op));
8952
	  return (stack[stacki]);
8951
	  return (stack[stacki]);
8953
	}
8952
	}
8953
      /* Enforce maximum stack depth of size-1 to avoid ++stacki writing
8954
         outside of the allocated space. Also enforce minimum > 0.
8955
         -- wad@google.com 14 Aug 2006 */
8956
      if (stacki >= sizeof (stack) / sizeof (*stack) - 1)
8957
	internal_error (__FILE__, __LINE__,
8958
	                _("location description stack too deep: %d"),
8959
	                stacki);
8960
      if (stacki <= 0)
8961
	internal_error (__FILE__, __LINE__,
8962
	                _("location description stack too shallow"));
8954
    }
8963
    }
8955
  return (stack[stacki]);
8964
  return (stack[stacki]);
8956
}
8965
}
(-)src.orig/gdb/dwarfread.c (-4 / +12 lines)
Lines 2138-2146 decode_line_numbers (char *linetable) Link Here
2138
2138
2139
   NOTES
2139
   NOTES
2140
2140
2141
   Note that stack[0] is unused except as a default error return.
2141
   Note that stack[0] is unused except as a default error return. */
2142
   Note that stack overflow is not yet handled.
2143
 */
2144
2142
2145
static int
2143
static int
2146
locval (struct dieinfo *dip)
2144
locval (struct dieinfo *dip)
Lines 2160-2166 locval (struct dieinfo *dip) Link Here
2160
  loc += nbytes;
2158
  loc += nbytes;
2161
  end = loc + locsize;
2159
  end = loc + locsize;
2162
  stacki = 0;
2160
  stacki = 0;
2163
  stack[stacki] = 0;
2161
  stack[++stacki] = 0;
2164
  dip->isreg = 0;
2162
  dip->isreg = 0;
2165
  dip->offreg = 0;
2163
  dip->offreg = 0;
2166
  dip->optimized_out = 1;
2164
  dip->optimized_out = 1;
Lines 2224-2229 locval (struct dieinfo *dip) Link Here
2224
	  stacki--;
2222
	  stacki--;
2225
	  break;
2223
	  break;
2226
	}
2224
	}
2225
      /* Enforce maximum stack depth of size-1 to avoid ++stacki writing
2226
         outside of the allocated space. Also enforce minimum > 0.
2227
         -- wad@google.com 14 Aug 2006 */
2228
      if (stacki >= sizeof (stack) / sizeof (*stack) - 1)
2229
	internal_error (__FILE__, __LINE__,
2230
	                _("location description stack too deep: %d"),
2231
	                stacki);
2232
      if (stacki <= 0)
2233
	internal_error (__FILE__, __LINE__,
2234
	                _("location description stack too shallow"));
2227
    }
2235
    }
2228
  return (stack[stacki]);
2236
  return (stack[stacki]);
2229
}
2237
}

Return to bug 144833