Module: wine Branch: master Commit: a92257798606e16ab67e982c8619e0fc950b879d URL: https://gitlab.winehq.org/wine/wine/-/commit/a92257798606e16ab67e982c8619e0f...
Author: Eric Pouech eric.pouech@gmail.com Date: Fri Dec 9 17:37:50 2022 +0100
winedbg: Avoid passing a non allocated buffer to HeapFree.
Latest changes to heap management can lead to a crash in this situation.
Signed-off-by: Eric Pouech eric.pouech@gmail.com
---
programs/winedbg/types.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/programs/winedbg/types.c b/programs/winedbg/types.c index be13c38a158..5f5f1346c67 100644 --- a/programs/winedbg/types.c +++ b/programs/winedbg/types.c @@ -820,7 +820,8 @@ BOOL types_print_type(const struct dbg_type* type, BOOL details, const WCHAR* va } if (varname && !printed) dbg_printf(" %ls", varname);
- HeapFree(GetProcessHeap(), 0, ptr); + if (name == ptr) + HeapFree(GetProcessHeap(), 0, ptr); return TRUE; }