|
From: <sv...@va...> - 2005-10-20 18:38:47
|
Author: tom
Date: 2005-10-20 19:38:08 +0100 (Thu, 20 Oct 2005)
New Revision: 4960
Log:
Don't assert if the DWARF line info reader is given so little data that
it can't even read the length of the block - just report an error as we
do if there isn't enough data for the rest of the block. Fix bug #114757.
Modified:
trunk/coregrind/m_debuginfo/dwarf.c
Modified: trunk/coregrind/m_debuginfo/dwarf.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_debuginfo/dwarf.c 2005-10-20 17:03:53 UTC (rev 4959=
)
+++ trunk/coregrind/m_debuginfo/dwarf.c 2005-10-20 18:38:08 UTC (rev 4960=
)
@@ -408,8 +408,6 @@
=3D=3D sizeof(DWARF2_Internal_LineInfo));
*/
=20
- vg_assert(noLargerThan > 0);
-
init_WordArray(&filenames);
init_WordArray(&dirnames);
init_WordArray(&fnidx2dir);
@@ -431,6 +429,12 @@
=20
external =3D (DWARF2_External_LineInfo *) data;
=20
+ if (sizeof (external->li_length) > noLargerThan) {
+ ML_(symerr)("DWARF line info appears to be corrupt "
+ "- the section is too small");
+ goto out;
+ }
+
/* Check the length of the block. */
info.li_length =3D * ((UInt *)(external->li_length));
=20
|