summaryrefslogtreecommitdiffstats
path: root/luni
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2014-11-14 16:40:33 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-11-14 16:40:34 +0000
commit657afa6cd8da378f30afe7b491e6d9de6c7c23fd (patch)
tree42eb0ed481d13ca8bdd4662088c94738c4cbf1df /luni
parent69c194df8d599730a8c5f0f79985cd7b4b2ece96 (diff)
parentef7f5a16547089a7cdba9e48d780720f606ff54a (diff)
downloadlibcore-657afa6cd8da378f30afe7b491e6d9de6c7c23fd.zip
libcore-657afa6cd8da378f30afe7b491e6d9de6c7c23fd.tar.gz
libcore-657afa6cd8da378f30afe7b491e6d9de6c7c23fd.tar.bz2
Merge "JarUtils: stop trying to build chain past candidates length" into lmp-mr1-dev
Diffstat (limited to 'luni')
-rw-r--r--luni/src/main/java/org/apache/harmony/security/utils/JarUtils.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/luni/src/main/java/org/apache/harmony/security/utils/JarUtils.java b/luni/src/main/java/org/apache/harmony/security/utils/JarUtils.java
index 5755dc2..917a3a8 100644
--- a/luni/src/main/java/org/apache/harmony/security/utils/JarUtils.java
+++ b/luni/src/main/java/org/apache/harmony/security/utils/JarUtils.java
@@ -249,6 +249,10 @@ public class JarUtils {
}
chain.add(issuerCert);
count++;
+ /* Prevent growing infinitely if there is a loop */
+ if (count > candidates.length) {
+ break;
+ }
issuer = issuerCert.getIssuerDN();
if (issuerCert.getSubjectDN().equals(issuer)) {
break;