From 795e4b744b1989ad80a06fc2fdc4128f7d5c422f Mon Sep 17 00:00:00 2001 From: Dmitry Batrak Date: Wed, 20 Jul 2016 11:12:19 +0300 Subject: getHBScriptCode script code validation (backport of JDK-8160695 from JDK 9) --- src/share/native/sun/font/scriptMapping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/share/native/sun/font/scriptMapping.c b/src/share/native/sun/font/scriptMapping.c index 64093508ad..038b63c125 100644 --- a/src/share/native/sun/font/scriptMapping.c +++ b/src/share/native/sun/font/scriptMapping.c @@ -85,7 +85,7 @@ hb_script_t ICU_to_Harfbuzz_ScriptCode[] = { 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]; -- cgit v1.2.3