[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    Re: [OpenJDK 2D-Dev] RFR: 8160695 : getHBScriptCode script code validation
From:       Brian Burkhalter <brian.burkhalter () oracle ! com>
Date:       2016-06-30 23:38:16
Message-ID: B317CB27-C865-417A-B56F-8DEF8AE3492E () oracle ! com
[Download RAW message or body]

+1

Brian

On Jun 30, 2016, at 4:09 PM, Phil Race <philip.race@oracle.com> wrote:

> https://bugs.openjdk.java.net/browse/JDK-8160695
> 
> A simple fix to ensure we check an array index is positive.
> In fact the value is always positive anyway, so this is just for "extra" safety.
> 
> diff --git a/src/java.desktop/share/native/libfontmanager/scriptMapping.c \
>                 b/src/java.desktop/share/native/libfontmanager/scriptMapping.c
> --- a/src/java.desktop/share/native/libfontmanager/scriptMapping.c
> +++ b/src/java.desktop/share/native/libfontmanager/scriptMapping.c
> @@ -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];
> 
> 
> -phil.
> 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic