any DWARF2 debug information. All make sure we don't fall over if
the .debug_info is less than four bytes long. Fixed bug 113642.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4856
UChar* end = debuginfo + debug_info_sz;
UInt blklen;
+ /* Make sure we at least have a header for the first block */
+ if (debug_info_sz < 4) {
+ ML_(symerr)( "Last block truncated in .debug_info; ignoring" );
+ return;
+ }
+
/* Iterate on all the blocks we find in .debug_info */
for ( block = debuginfo; block < end - 4; block += blklen + 4 ) {
stabstr, stabstr_sz );
}
# endif
- if (debug_line) {
+ if (debug_info && debug_abbv && debug_line && debug_str) {
ML_(read_debuginfo_dwarf2) ( si,
debug_info, debug_info_sz,
debug_abbv,