From 51c694274f3eef1fbb18ac54794bb43eab333b4b Mon Sep 17 00:00:00 2001 From: Giannis Adamopoulos Date: Tue, 3 Oct 2017 21:51:46 +0300 Subject: [PATCH] [RTL] find_string_index: name parameter may not be null terminated --- sdk/lib/rtl/actctx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk/lib/rtl/actctx.c b/sdk/lib/rtl/actctx.c index 3768f7201b4..4cf9bbaa4bd 100644 --- a/sdk/lib/rtl/actctx.c +++ b/sdk/lib/rtl/actctx.c @@ -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;