The first one is harmful (when symbol name's length is > 1000 characters), the second one is harmless (overallocation).
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/dbghelp/symbol.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c index 3fc3438eeba..8189f6a175e 100644 --- a/dlls/dbghelp/symbol.c +++ b/dlls/dbghelp/symbol.c @@ -1170,8 +1170,7 @@ struct sym_enumW PSYM_ENUMERATESYMBOLS_CALLBACKW cb; void* ctx; PSYMBOL_INFOW sym_info; - char buffer[sizeof(SYMBOL_INFOW) + MAX_SYM_NAME]; - + char buffer[sizeof(SYMBOL_INFOW) + MAX_SYM_NAME * sizeof(WCHAR)]; };
static BOOL CALLBACK sym_enumW(PSYMBOL_INFO si, ULONG size, PVOID ctx) @@ -1438,7 +1437,7 @@ BOOL WINAPI SymFromNameW(HANDLE process, const WCHAR *name, SYMBOL_INFOW *symbol
TRACE("(%p, %s, %p)\n", process, debugstr_w(name), symbol);
- len = sizeof(*si) + symbol->MaxNameLen * sizeof(WCHAR); + len = sizeof(*si) + symbol->MaxNameLen; if (!(si = HeapAlloc(GetProcessHeap(), 0, len))) return FALSE;
len = WideCharToMultiByte(CP_ACP, 0, name, -1, NULL, 0, NULL, NULL);