Prevent the jvm from crashing when it encounters a font with an

illegal glyph name (like in x11/freefonts). Problem reported by Jan Zach.
This commit is contained in:
kurt 2006-07-28 13:18:45 +00:00
parent 15f1fe1f7e
commit e8329de2c0
2 changed files with 19 additions and 3 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.22 2006/07/10 13:17:39 kurt Exp $
# $OpenBSD: Makefile,v 1.23 2006/07/28 13:18:45 kurt Exp $
ONLY_FOR_ARCHS= amd64 i386
@ -6,8 +6,8 @@ COMMENT= "Java2(TM) Standard Edition Dev Kit v${V}"
COMMENT-jre= "Java2(TM) Standard Edition Runtime Environment v${V}"
V= 1.5.0
DISTNAME= jdk-1_5_0
PKGNAME= jdk-${V}p18
PKGNAME-jre= jre-${V}p18
PKGNAME= jdk-${V}p19
PKGNAME-jre= jre-${V}p19
CATEGORIES= devel/jdk java

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-j2se_src_share_native_sun_font_t2k_t1_c,v 1.1 2006/07/28 13:18:45 kurt Exp $
--- j2se/src/share/native/sun/font/t2k/t1.c.orig Tue Jul 18 16:07:09 2006
+++ j2se/src/share/native/sun/font/t2k/t1.c Tue Jul 18 16:32:28 2006
@@ -2035,9 +2035,10 @@ static int PSNameToUnicode( char *PSName
if ( firstChar >= 'A' && firstChar <= 'Z' )
lookupIndex = firstChar - 'A';
- else
+ else if ( firstChar >= 'a' && firstChar <= 'z' )
lookupIndex = firstChar - 'a' + 26;
-
+ else /* underscore is also valid but not handled */
+ return 0;
startIndex = PSNAME_START_INDEX[ lookupIndex ];
endIndex = PSNAME_START_INDEX[ lookupIndex + 1 ];