https://git.reactos.org/?p=reactos.git;a=commitdiff;h=428e4617e94e6cca8379c853a8cdea8f9b487dbf

commit 428e4617e94e6cca8379c853a8cdea8f9b487dbf
Author:     Mark Jansen <[email protected]>
AuthorDate: Thu Mar 15 19:11:43 2018 +0100
Commit:     Mark Jansen <[email protected]>
CommitDate: Thu Mar 15 20:16:04 2018 +0100

    [WIN32K] Do not try to compare a long name against a truncated name.
    This fixes gdiplus_winetest:font crashing.
    ROSTESTS-154
---
 win32ss/gdi/ntgdi/freetype.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c
index d94af290a1..92ab8b4461 100644
--- a/win32ss/gdi/ntgdi/freetype.c
+++ b/win32ss/gdi/ntgdi/freetype.c
@@ -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;
         }

Reply via email to