From eb75eea64fbb0c9bfb86ed1fc1ef5dc1248144e0 Mon Sep 17 00:00:00 2001 From: Markus Doits Date: Mon, 17 Jan 2011 22:21:41 +0000 Subject: Allow get_master_key to accept null string Return earlier on wrong length, too. --- src/org/thialfihar/android/apg/ApgService.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/org/thialfihar/android/apg/ApgService.java b/src/org/thialfihar/android/apg/ApgService.java index 0cfb065db..e395a808d 100644 --- a/src/org/thialfihar/android/apg/ApgService.java +++ b/src/org/thialfihar/android/apg/ApgService.java @@ -147,6 +147,9 @@ public class ApgService extends Service { * @return master key if found, or 0 */ private static long get_master_key(String search_key) { + if (search_key == null || search_key.length() != 8) { + return 0; + } ArrayList tmp = new ArrayList(); tmp.add(search_key); long[] _keys = get_master_key(tmp); -- cgit v1.2.3