mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-27 11:12:15 -05:00
Fixed possible ArrayIndexOutOfBoundsException.
This commit is contained in:
parent
704821a8db
commit
52200edfd7
@ -135,7 +135,7 @@ public class KeychainIntentService extends IntentService implements Progressable
|
|||||||
private static final IOType[] values = values();
|
private static final IOType[] values = values();
|
||||||
|
|
||||||
public static IOType fromInt(int n) {
|
public static IOType fromInt(int n) {
|
||||||
if(n >= values.length) {
|
if(n < 0 || n >= values.length) {
|
||||||
return UNKNOWN;
|
return UNKNOWN;
|
||||||
} else {
|
} else {
|
||||||
return values[n];
|
return values[n];
|
||||||
|
@ -44,7 +44,7 @@ public class KeychainIntentServiceHandler extends Handler {
|
|||||||
|
|
||||||
public static MessageStatus fromInt(int n)
|
public static MessageStatus fromInt(int n)
|
||||||
{
|
{
|
||||||
if(n >= values.length) {
|
if(n < 0 || n >= values.length) {
|
||||||
return UNKNOWN;
|
return UNKNOWN;
|
||||||
} else {
|
} else {
|
||||||
return values[n];
|
return values[n];
|
||||||
|
Loading…
Reference in New Issue
Block a user