mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-23 04:24:49 +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.
|
* Get the error enum value (if any) associated with this exception.
|
||||||
*/
|
*/
|
||||||
public Error getError() {
|
public Error getError() {
|
||||||
return errorCode < ALL_ERRORS.length ?
|
return (errorCode >= 0 && errorCode < ALL_ERRORS.length) ?
|
||||||
ALL_ERRORS[errorCode] :
|
ALL_ERRORS[errorCode] :
|
||||||
null;
|
null;
|
||||||
}
|
}
|
||||||
|
@ -154,7 +154,7 @@ public final class UcryptoException extends ProviderException {
|
||||||
*/
|
*/
|
||||||
static String getErrorMessage(int errorCode) {
|
static String getErrorMessage(int errorCode) {
|
||||||
String message;
|
String message;
|
||||||
if (errorCode < ALL_ERRORS.length) {
|
if (errorCode >= 0 && errorCode < ALL_ERRORS.length) {
|
||||||
message = ALL_ERRORS[errorCode].name();
|
message = ALL_ERRORS[errorCode].name();
|
||||||
} else {
|
} else {
|
||||||
message = "0x" + Integer.toHexString(errorCode);
|
message = "0x" + Integer.toHexString(errorCode);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue