Skip to content

Commit 51c6942

Browse files
committed
[RTL] find_string_index: name parameter may not be null terminated
1 parent ff8d8a8 commit 51c6942

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sdk/lib/rtl/actctx.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3222,7 +3222,8 @@ static struct string_index *find_string_index(const struct strsection_header *se
32223222
{
32233223
const WCHAR *nameW = (WCHAR*)((BYTE*)section + iter->name_offset);
32243224

3225-
if (!strcmpiW(nameW, name->Buffer))
3225+
if (!_wcsnicmp(nameW, name->Buffer, name->Length / sizeof(WCHAR)) &&
3226+
wcslen(nameW) == name->Length / sizeof(WCHAR))
32263227
{
32273228
index = iter;
32283229
break;

0 commit comments

Comments
 (0)