[RTL] find_string_index: name parameter may not be null terminated
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Tue, 3 Oct 2017 18:51:46 +0000 (21:51 +0300)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Sun, 24 Dec 2017 19:19:03 +0000 (21:19 +0200)
sdk/lib/rtl/actctx.c

index 3768f72..4cf9bba 100644 (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;