Commit 83c30a55 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

dbghelp: Made stabs parsing a bit more robust.

Enhance dbghelp's robustness against bogus stabs sections found in meetro.exe (as reported by Jan Zerebecki).
parent 95d057a8
......@@ -1327,13 +1327,17 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
stabs_parse_type(ptr));
break;
case N_LBRAC:
block = symt_open_func_block(module, curr_func, block,
stab_ptr->n_value, 0);
pending_flush(&pending, module, curr_func, block);
if (curr_func)
{
block = symt_open_func_block(module, curr_func, block,
stab_ptr->n_value, 0);
pending_flush(&pending, module, curr_func, block);
}
break;
case N_RBRAC:
block = symt_close_func_block(module, curr_func, block,
stab_ptr->n_value);
if (curr_func)
block = symt_close_func_block(module, curr_func, block,
stab_ptr->n_value);
break;
case N_PSYM:
/* These are function parameters. */
......
......@@ -365,6 +365,7 @@ struct symt_block* symt_close_func_block(struct module* module,
struct symt_function* func,
struct symt_block* block, unsigned pc)
{
assert(func);
assert(func->symt.tag == SymTagFunction);
if (pc) block->size = func->address + pc - block->address;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment