RFR: 8189092: ArrayIndexOutOfBoundsException on Linux in getCachedGlyph
Phil Race
prr at openjdk.org
Sat Oct 26 15:09:55 UTC 2019
On Sat, 26 Oct 2019 11:33:15 GMT, Laurent Bourgès <github.com+5607073+bourgesl at openjdk.org> wrote:
> On Fri, 25 Oct 2019 20:18:48 GMT, Phil Race <prr at openjdk.org> wrote:
>
>> I have added an evaluation in https://bugs.openjdk.java.net/browse/JDK-8207839
>> Please read that for more detail, but basically we are not properly preventing or
>> handling cases where fontconfig causes us to overflow the byte storage used
>> for a font "slot".
>>
>> ----------------
>>
>> Commits:
>> - b6c19466: Fix whitespace
>> - e00ef992: 8189092: ArrayIndexOutOfBoundsException on Linux in getCachedGlyph
>>
>> Changes: https://git.openjdk.java.net/jfx/pull/24/files
>> Webrev: https://webrevs.openjdk.java.net/jfx/24/webrev.00
>> Issue: https://bugs.openjdk.java.net/browse/JDK-8189092
>> Stats: 15 lines in 3 files changed: 12 ins; 0 del; 3 mod
>> Patch: https://git.openjdk.java.net/jfx/pull/24.diff
>> Fetch: git fetch https://git.openjdk.java.net/jfx pull/24/head:pull/24
>
> I had a quick look by curiosity as it is not my field. Explanations really make sense, thanks Phil.
> Bit masks & shifts look good and definitely it will make that code safer.
> However I wonder how to deal with more than 255 fonts (1 byte limit) as it may happen on some systems, even not reallistic.
> Thanks
> However I wonder how to deal with more than 255 fonts (1 byte limit) as it may happen on some systems, even not reallistic.
That would have to be > 255 fonts *per fontconfig font*, and we have additional filters
to eliminate fonts that don't add value (at least we do now with fixing the bug in that
code in fontpath_linux.c).
We could rework things to use 16 bit for font slot, although that would be a bigger change
and require more testing and really this is never going to be needed on Windows or Mac,
just some very small number of Linux systems that are not default configs ..
PR: https://git.openjdk.java.net/jfx/pull/24
More information about the openjfx-dev
mailing list