On Fri, 16 Oct 2026 22:54:57 GMT, Naoto Sato <[email protected]> wrote:

> Adds validation for lengths and counts read from i18n binary data before 
> allocating arrays.
> 
> - `RuleBasedBreakIterator` and `UBiDiProps` validate declared lengths against 
> the remaining data.
> - `ZoneInfoFile` validates transition and rule counts against the limits 
> already used by `ZoneRules`.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

Looks good to me.

src/java.base/share/classes/jdk/internal/icu/impl/UBiDiProps.java line 69:

> 67:         int i, count;
> 68:         count=bytes.getInt();
> 69:         if(count < IX_TOP || count - 1 > bytes.remaining() / 4) {

Use Integer.BYTES here too?

test/jdk/sun/util/calendar/ZoneRulesDataValidation.java line 76:

> 74: 
> 75:     @ParameterizedTest
> 76:     @MethodSource("maxValue")

Probably cleaner to split this up into a too large and too small test since the 
negative size case doesn’t use the max value supplied by the method source.

-------------

Marked as reviewed by jlu (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/33420#pullrequestreview-5578260971
PR Review Comment: https://git.openjdk.org/jdk/pull/33420#discussion_r4319284317
PR Review Comment: https://git.openjdk.org/jdk/pull/33420#discussion_r4319751630

Reply via email to