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.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4960
== sizeof(DWARF2_Internal_LineInfo));
*/
- vg_assert(noLargerThan > 0);
-
init_WordArray(&filenames);
init_WordArray(&dirnames);
init_WordArray(&fnidx2dir);
external = (DWARF2_External_LineInfo *) data;
+ 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 = * ((UInt *)(external->li_length));