[RFA] mdebugread.c (psymtab_to_symtab_1): assert that 'fh' is not null

Michael Snyder
2011-03-04T22:15:45Z

[-- Attachment #1: Type: text/plain, Size: 86 bytes --]

This occurs along a path where fh *could* be null, and then we
dereference it.

OK?

[-- Attachment #2: null3.txt --]
[-- Type: text/plain, Size: 741 bytes --]

2011-03-04 Michael Snyder <msnyder@msnyder-server.eng.vmware.com>

* mdebugread.c (psymtab_to_symtab_1): Assert fh is not null.

Index: mdebugread.c
===================================================================
RCS file: /cvs/src/src/gdb/mdebugread.c,v
retrieving revision 1.120
diff -u -p -r1.120 mdebugread.c
--- mdebugread.c 2 Mar 2011 23:54:16 -0000 1.120
+++ mdebugread.c 4 Mar 2011 22:10:46 -0000
@@ -4323,6 +4323,7 @@ psymtab_to_symtab_1 (struct partial_symt
top_stack->blocktype = stFile;

ext_ptr = PST_PRIVATE (pst)->extern_tab;
+ gdb_assert (fh);
for (i = PST_PRIVATE (pst)->extern_count; --i >= 0; ext_ptr++)
parse_external (ext_ptr, fh->fBigendian,
pst->section_offsets, pst->objfile);