changeset 39549:26cd79781f7a

8160695: getHBScriptCode script code validation Reviewed-by: bpb
author prr
date Fri, 01 Jul 2016 14:29:36 -0700
parents ad363c42f790
children 8d587cab45d2
files jdk/src/java.desktop/share/native/libfontmanager/scriptMapping.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/java.desktop/share/native/libfontmanager/scriptMapping.c	Fri Jul 01 14:27:13 2016 -0700
+++ b/jdk/src/java.desktop/share/native/libfontmanager/scriptMapping.c	Fri Jul 01 14:29:36 2016 -0700
@@ -85,7 +85,7 @@
 int MAX_ICU_SCRIPTCODE = 45;
 
 hb_script_t getHBScriptCode(int code) {
-    if (code > MAX_ICU_SCRIPTCODE) {
+    if ((code < 0) || (code > MAX_ICU_SCRIPTCODE)) {
         return HB_SCRIPT_INVALID;
     }
     return ICU_to_Harfbuzz_ScriptCode[code];