Commit ced7436f authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

Ensures, when we cannot demangle the string, to return the mangled

name instead of a NULL pointer.
parent 73b0e94b
......@@ -1152,6 +1152,7 @@ char* __unDNameEx(char* buffer, const char* mangled, int buflen,
void* unknown, unsigned short int flags)
{
struct parsed_symbol sym;
const char* result;
TRACE("(%p,%s,%d,%p,%p,%p,%x) stub!\n",
buffer, mangled, buflen, memget, memfree, unknown, flags);
......@@ -1171,20 +1172,17 @@ char* __unDNameEx(char* buffer, const char* mangled, int buflen,
sym.mem_free_ptr = memfree;
sym.current = mangled;
if (symbol_demangle(&sym))
result = symbol_demangle(&sym) ? sym.result : mangled;
if (buffer && buflen)
{
if (buffer && buflen)
{
memcpy(buffer, sym.result, buflen - 1);
buffer[buflen - 1] = '\0';
}
else
{
buffer = memget(strlen(sym.result) + 1);
if (buffer) strcpy(buffer, sym.result);
}
memcpy(buffer, result, buflen - 1);
buffer[buflen - 1] = '\0';
}
else
{
buffer = memget(strlen(result) + 1);
if (buffer) strcpy(buffer, result);
}
else buffer = NULL;
und_free_all(&sym);
......
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