Commit 972a9495 authored by Peter Berg Larsen's avatar Peter Berg Larsen Committed by Alexandre Julliard

Eliminate strncpy and correct some NameLen bugs.

parent 716bf4d6
...@@ -398,11 +398,12 @@ BOOL WINAPI SymEnumTypes(HANDLE hProcess, ULONG64 BaseOfDll, ...@@ -398,11 +398,12 @@ BOOL WINAPI SymEnumTypes(HANDLE hProcess, ULONG64 BaseOfDll,
tmp = symt_get_name(type); tmp = symt_get_name(type);
if (tmp) if (tmp)
{ {
sym_info->NameLen = strlen(tmp) + 1; sym_info->NameLen = min(strlen(tmp),sym_info->MaxNameLen-1);
strncpy(sym_info->Name, tmp, min(sym_info->NameLen, sym_info->MaxNameLen)); memcpy(sym_info->Name, tmp, sym_info->NameLen);
sym_info->Name[sym_info->MaxNameLen - 1] = '\0'; sym_info->Name[sym_info->NameLen] = '\0';
} }
else sym_info->Name[sym_info->NameLen = 0] = '\0'; else
sym_info->Name[sym_info->NameLen = 0] = '\0';
if (!EnumSymbolsCallback(sym_info, sym_info->Size, UserContext)) break; if (!EnumSymbolsCallback(sym_info, sym_info->Size, UserContext)) break;
} }
return TRUE; return TRUE;
......
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