From 8c460b043e1cbaf1f2d74958033bb24dea66a390 Mon Sep 17 00:00:00 2001 From: Nikita Gubarkov Date: Sun, 5 Jun 2022 15:34:47 +0000 Subject: [PATCH] 8287609: macOS: SIGSEGV at [CoreFoundation] CFArrayGetCount / sun.font.CFont.getTableBytesNative Reviewed-by: prr --- src/java.desktop/macosx/native/libawt_lwawt/font/AWTFont.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/java.desktop/macosx/native/libawt_lwawt/font/AWTFont.m b/src/java.desktop/macosx/native/libawt_lwawt/font/AWTFont.m index 360baab2b9a..5e1d6ba0cb1 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/font/AWTFont.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/font/AWTFont.m @@ -379,6 +379,9 @@ JNI_COCOA_ENTER(env); CTFontRef ctfont = (CTFontRef)nsFont; CFArrayRef tagsArray = CTFontCopyAvailableTables(ctfont, kCTFontTableOptionNoOptions); + if (tagsArray == NULL) { + return NULL; + } CFIndex numTags = CFArrayGetCount(tagsArray); for (i=0; i