Eric Pouech : dbghelp: Correctly handle the absence of IPI stream.
Module: wine Branch: master Commit: 12f2a1768cff030619eecd9c0bf6b90583ee6177 URL: https://gitlab.winehq.org/wine/wine/-/commit/12f2a1768cff030619eecd9c0bf6b90... Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Fri Sep 9 17:06:04 2022 +0200 dbghelp: Correctly handle the absence of IPI stream. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> --- dlls/dbghelp/msc.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c index 10fcf398140..811c8ffa165 100644 --- a/dlls/dbghelp/msc.c +++ b/dlls/dbghelp/msc.c @@ -3119,15 +3119,15 @@ static void pdb_module_remove(struct process* pcsn, struct module_format* modfmt HeapFree(GetProcessHeap(), 0, modfmt); } -static void pdb_convert_types_header(PDB_TYPES* types, const BYTE* image) +static BOOL pdb_convert_types_header(PDB_TYPES* types, const BYTE* image) { - memset(types, 0, sizeof(PDB_TYPES)); - if (!image) return; + if (!image) return FALSE; if (*(const DWORD*)image < 19960000) /* FIXME: correct version? */ { /* Old version of the types record header */ const PDB_TYPES_OLD* old = (const PDB_TYPES_OLD*)image; + memset(types, 0, sizeof(PDB_TYPES)); types->version = old->version; types->type_offset = sizeof(PDB_TYPES_OLD); types->type_size = old->type_size; @@ -3140,6 +3140,7 @@ static void pdb_convert_types_header(PDB_TYPES* types, const BYTE* image) /* New version of the types record header */ *types = *(const PDB_TYPES*)image; } + return TRUE; } static void pdb_convert_symbols_header(PDB_SYMBOLS* symbols, @@ -3255,7 +3256,8 @@ static BOOL pdb_init_type_parse(const struct msc_debug_info* msc_dbg, ctp->offset = NULL; ctp->hash = NULL; ctp->alloc_hash = NULL; - pdb_convert_types_header(&ctp->header, image); + if (!pdb_convert_types_header(&ctp->header, image)) + return FALSE; /* Check for unknown versions */ switch (ctp->header.version)
participants (1)
-
Alexandre Julliard