[PATCH 0/1] MR8241: dbghelp: Avoid use after free by moving assignment before vector_add (ASan).
Followup to 5c54087c47. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=58340 Co-authored-by: Eric Pouech <epouech(a)codeweavers.com> -- https://gitlab.winehq.org/wine/wine/-/merge_requests/8241
From: Bernhard Übelacker <bernhardu(a)mailbox.org> Followup to 5c54087c47. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=58340 Co-authored-by: Eric Pouech <epouech(a)codeweavers.com> --- dlls/dbghelp/symbol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c index f051fa793ff..29a32ad7dcf 100644 --- a/dlls/dbghelp/symbol.c +++ b/dlls/dbghelp/symbol.c @@ -432,6 +432,8 @@ void symt_add_func_line(struct module* module, struct symt_function* func, WARN("Duplicate addition of line number in %s\n", debugstr_a(func->hash_elt.name)); return; } + /* clear previous last */ + if (prev) prev->is_last = 0; if (!last_matches) { /* we shouldn't have line changes on first line of function */ @@ -442,8 +444,6 @@ void symt_add_func_line(struct module* module, struct symt_function* func, dli->line_number = 0; dli->u.source_file = source_idx; } - /* clear previous last */ - if (prev) prev->is_last = 0; dli = vector_add(&func->vlines, &module->pool); dli->is_source_file = 0; dli->is_first = 0; /* only a source file can be first */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/8241
This merge request was approved by eric pouech. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/8241
participants (2)
-
Bernhard Übelacker -
eric pouech (@epo)