Commit 85557f36 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

dbghelp: Fix two internal buffer allocations.

parent 5c271afc
...@@ -1170,8 +1170,7 @@ struct sym_enumW ...@@ -1170,8 +1170,7 @@ struct sym_enumW
PSYM_ENUMERATESYMBOLS_CALLBACKW cb; PSYM_ENUMERATESYMBOLS_CALLBACKW cb;
void* ctx; void* ctx;
PSYMBOL_INFOW sym_info; 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) 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 ...@@ -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); 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; if (!(si = HeapAlloc(GetProcessHeap(), 0, len))) return FALSE;
len = WideCharToMultiByte(CP_ACP, 0, name, -1, NULL, 0, NULL, NULL); len = WideCharToMultiByte(CP_ACP, 0, name, -1, NULL, 0, NULL, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment