[RTL] find_string_index: name parameter may not be null terminated

This commit is contained in:
Giannis Adamopoulos 2017-10-03 21:51:46 +03:00
parent ff8d8a8162
commit 51c694274f

View file

@ -3222,7 +3222,8 @@ static struct string_index *find_string_index(const struct strsection_header *se
{
const WCHAR *nameW = (WCHAR*)((BYTE*)section + iter->name_offset);
if (!strcmpiW(nameW, name->Buffer))
if (!_wcsnicmp(nameW, name->Buffer, name->Length / sizeof(WCHAR)) &&
wcslen(nameW) == name->Length / sizeof(WCHAR))
{
index = iter;
break;