[WIN32K] Do not try to compare a long name against a truncated name.
authorMark Jansen <mark.jansen@reactos.org>
Thu, 15 Mar 2018 18:11:43 +0000 (19:11 +0100)
committerMark Jansen <mark.jansen@reactos.org>
Thu, 15 Mar 2018 19:16:04 +0000 (20:16 +0100)
This fixes gdiplus_winetest:font crashing.
ROSTESTS-154

win32ss/gdi/ntgdi/freetype.c

index d94af29..92ab8b4 100644 (file)
@@ -2522,8 +2522,8 @@ GetFontFamilyInfoForList(LPLOGFONTW LogFont,
 
         FontFamilyFillInfo(&InfoEntry, NULL, NULL, FontGDI);
 
-        if (_wcsicmp(LogFont->lfFaceName, InfoEntry.EnumLogFontEx.elfLogFont.lfFaceName) != 0 &&
-            _wcsicmp(LogFont->lfFaceName, InfoEntry.EnumLogFontEx.elfFullName) != 0)
+        if (_wcsnicmp(LogFont->lfFaceName, InfoEntry.EnumLogFontEx.elfLogFont.lfFaceName, RTL_NUMBER_OF(LogFont->lfFaceName)-1) != 0 &&
+            _wcsnicmp(LogFont->lfFaceName, InfoEntry.EnumLogFontEx.elfFullName, RTL_NUMBER_OF(LogFont->lfFaceName)-1) != 0)
         {
             continue;
         }