From: Tom Hughes Date: Thu, 20 Oct 2005 18:38:08 +0000 (+0000) Subject: Don't assert if the DWARF line info reader is given so little data that X-Git-Tag: svn/VALGRIND_3_1_0~272 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=626b0fbdc37409cb2546fb66bb808586b80a529a;p=thirdparty%2Fvalgrind.git 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. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4960 --- diff --git a/coregrind/m_debuginfo/dwarf.c b/coregrind/m_debuginfo/dwarf.c index e2794c7eab..1d5cc8022a 100644 --- a/coregrind/m_debuginfo/dwarf.c +++ b/coregrind/m_debuginfo/dwarf.c @@ -408,8 +408,6 @@ void read_dwarf2_lineblock ( SegInfo* si, == sizeof(DWARF2_Internal_LineInfo)); */ - vg_assert(noLargerThan > 0); - init_WordArray(&filenames); init_WordArray(&dirnames); init_WordArray(&fnidx2dir); @@ -431,6 +429,12 @@ void read_dwarf2_lineblock ( SegInfo* si, 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));