> Rfc2253Parser silently accepted an empty RDN (no attributeTypeAndValue pair)
> instead of
> throwing InvalidNameException. Rdn.getType()/getValue() then indexed an empty
> internal list, throwing an uncaught IndexOutOfBoundsException instead of the
> documented
> exception.
>
> Two independent entry points:
>
> Rdn("") - the original fuzzer-found crash.
> LdapName("cn=x,") / LdapName.add("") - a string with a trailing , or ;, which
> never goes
> through Rdn(String) at all (LdapName builds the RDN directly via
> Rfc2253Parser).
>
> Add one check, rdn.size() == 0, throw InvalidNameException, placed in
>
> Rfc2253Parser.doParse(Rdn) - the single method both paths funnel through.
>
> Also add a regression check that "cn=a,,cn=b" still throws as before.
>
>
>
>
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK
> Interim AI Policy](https://openjdk.org/legal/ai).
Timofei Fedotov has updated the pull request with a new target base due to a
merge or a rebase. The incremental webrev excludes the unrelated changes
brought in by the merge/rebase. The pull request contains 14 additional commits
since the last revision:
- Merge branch 'openjdk:master' into 8391649
- Merge branch 'openjdk:master' into 8391649
- Merge branch 'openjdk:master' into 8391649
- Replace assert with check in Rdn constructor
- Add new subtests in regression test
- Add assert in Rdn constructor
- Update regression test
- Change message in body InvalidNameException
- Add numAttributes method and correct Rfc2253Parser
- Correct comment and move throw inside if
- ... and 4 more: https://git.openjdk.org/jdk/compare/3f2eb840...069c1066
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/32648/files
- new: https://git.openjdk.org/jdk/pull/32648/files/55761f2f..069c1066
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=32648&range=09
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=32648&range=08-09
Stats: 10165 lines in 296 files changed: 7713 ins; 1205 del; 1247 mod
Patch: https://git.openjdk.org/jdk/pull/32648.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/32648/head:pull/32648
PR: https://git.openjdk.org/jdk/pull/32648