From 7664bceec3422f55db46d7d1bf908ae6110a6548 Mon Sep 17 00:00:00 2001 From: Thecrazyskull Date: Thu, 26 Jan 2017 08:59:51 -0600 Subject: [PATCH] KeySetManagerService: prevent NPE * If pubKeys is null, we cannot check the size of pubKeys Test: none Change-Id: I3b4074d8727b084fea98a0e0a5a0afbd96bea41d --- .../core/java/com/android/server/pm/KeySetManagerService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/pm/KeySetManagerService.java b/services/core/java/com/android/server/pm/KeySetManagerService.java index 0de0c924db723..49d3c8bccdff5 100644 --- a/services/core/java/com/android/server/pm/KeySetManagerService.java +++ b/services/core/java/com/android/server/pm/KeySetManagerService.java @@ -287,7 +287,7 @@ public class KeySetManagerService { for (int i = 0; i < defMapSize; i++) { String alias = definedMapping.keyAt(i); ArraySet pubKeys = definedMapping.valueAt(i); - if (alias != null && pubKeys != null || pubKeys.size() > 0) { + if (alias != null && pubKeys != null && pubKeys.size() > 0) { KeySetHandle ks = addKeySetLPw(pubKeys); newKeySetAliases.put(alias, ks.getId()); }