RFR: 8369995: Implement extra logging and/or propagate errors in X509KeyManagerImpl and fix StringIndexOutOfBoundsException [v2]

Mikhail Yankelevich myankelevich at openjdk.org
Fri Oct 17 12:18:47 UTC 2025


On Thu, 16 Oct 2025 18:32:20 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:

>> Mikhail Yankelevich has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   index out of bounds and string out of bounds exception fixes
>
> src/java.base/share/classes/sun/security/ssl/X509KeyManagerImpl.java line 248:
> 
>> 246:                  KeyStoreException |
>> 247:                  NumberFormatException |
>> 248:                  NoSuchAlgorithmException e) {
> 
> Could you fix the (preexisting) IndexOutOfBounds issues?
> - the check in line 226 looks wrong; `secondDot == firstDot` will always return `false`. It should be `secondDot == -1` instead; the current version will probably throw SIOOBE on aliases with a single dot, like `A.1`.
> - `builders.get(builderIndex)` might throw IOOBE if builderIndex is out of range for the builders list, like `A.-1.B`.
> 
> The only exceptions that we want to propagate here are the `RuntimeException`s thrown by `builder` and `ks`, and we only propagate them so that they can be reported and fixed.

I agree, changed in the next commit. Will update the ticket as well

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27851#discussion_r2439666430


More information about the security-dev mailing list