mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-22 20:14:43 +02:00
8197443: ArrayIndexOutOfBoundsException in UcryptoException.getError
Reviewed-by: mullan
This commit is contained in:
parent
5d5303cb87
commit
b825e581a9
1 changed files with 2 additions and 2 deletions
|
@ -134,7 +134,7 @@ public final class UcryptoException extends ProviderException {
|
|||
* Get the error enum value (if any) associated with this exception.
|
||||
*/
|
||||
public Error getError() {
|
||||
return errorCode < ALL_ERRORS.length ?
|
||||
return (errorCode >= 0 && errorCode < ALL_ERRORS.length) ?
|
||||
ALL_ERRORS[errorCode] :
|
||||
null;
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ public final class UcryptoException extends ProviderException {
|
|||
*/
|
||||
static String getErrorMessage(int errorCode) {
|
||||
String message;
|
||||
if (errorCode < ALL_ERRORS.length) {
|
||||
if (errorCode >= 0 && errorCode < ALL_ERRORS.length) {
|
||||
message = ALL_ERRORS[errorCode].name();
|
||||
} else {
|
||||
message = "0x" + Integer.toHexString(errorCode);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue