From: Aric Stewart Subject: [PATCH] usp10/tests: Catch case where enumerated font name is too long Message-Id: <5605641E.3090703@codeweavers.com> Date: Fri, 25 Sep 2015 10:11:26 -0500 Fixes crashes in the test on Mac OS X machines Signed-off-by: Aric Stewart --- dlls/usp10/tests/usp10.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c index 0db98d9..92b17c5 100644 --- a/dlls/usp10/tests/usp10.c +++ b/dlls/usp10/tests/usp10.c @@ -1993,6 +1993,11 @@ static void test_ScriptGetFontProperties(HDC hdc) for (i = 0; i < efnd.total; i++) { + if (strlen((char *)efnd.elf[i].elfFullName) >= LF_FACESIZE) + { + trace("Font name to long to test: %s\n",(char *)efnd.elf[i].elfFullName); + continue; + } lstrcpyA(lf.lfFaceName, (char *)efnd.elf[i].elfFullName); font = CreateFontIndirectA(&lf); oldfont = SelectObject(hdc, font); @@ -2034,6 +2039,11 @@ static void test_ScriptGetFontProperties(HDC hdc) for (i = 0; i < efnd.total; i++) { + if (strlen((char *)efnd.elf[i].elfFullName) >= LF_FACESIZE) + { + trace("Font name to long to test: %s\n",(char *)efnd.elf[i].elfFullName); + continue; + } lstrcpyA(lf.lfFaceName, (char *)efnd.elf[i].elfFullName); font = CreateFontIndirectA(&lf); oldfont = SelectObject(hdc, font);