Eric Pouech : dbghelp: Made stabs parsing a bit more robust.
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Aug 9 16:18:55 CDT 2006
Module: wine
Branch: refs/heads/master
Commit: 83c30a55b8beb1f5aa3cc1649ba22af32dcf778d
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=83c30a55b8beb1f5aa3cc1649ba22af32dcf778d
Author: Eric Pouech <eric.pouech at wanadoo.fr>
Date: Wed Aug 9 20:53:32 2006 +0200
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).
---
dlls/dbghelp/stabs.c | 14 +++++++++-----
dlls/dbghelp/symbol.c | 1 +
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/dlls/dbghelp/stabs.c b/dlls/dbghelp/stabs.c
index dd9a70c..e94bd71 100644
--- a/dlls/dbghelp/stabs.c
+++ b/dlls/dbghelp/stabs.c
@@ -1327,13 +1327,17 @@ #endif
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. */
diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c
index d93bdd2..2354c1a 100644
--- a/dlls/dbghelp/symbol.c
+++ b/dlls/dbghelp/symbol.c
@@ -365,6 +365,7 @@ struct symt_block* symt_close_func_block
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;
More information about the wine-cvs
mailing list