harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r388407 - /incubator/harmony/enhanced/classlib/trunk/modules/security/src/common/javasrc/java/security/cert/X509CertSelector.java
Date Fri, 24 Mar 2006 06:24:46 GMT
Author: tellison
Date: Thu Mar 23 22:24:43 2006
New Revision: 388407

URL: http://svn.apache.org/viewcvs?rev=388407&view=rev
Log:
Apply patch HARMONY-186 (X509CertSelector.match throws ArrayIndexOutOfBoundsException when
checks keyUsage criterion)

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/common/javasrc/java/security/cert/X509CertSelector.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/common/javasrc/java/security/cert/X509CertSelector.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/common/javasrc/java/security/cert/X509CertSelector.java?rev=388407&r1=388406&r2=388407&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/common/javasrc/java/security/cert/X509CertSelector.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/common/javasrc/java/security/cert/X509CertSelector.java
Thu Mar 23 22:24:43 2006
@@ -909,7 +909,9 @@
             boolean[] ku = cert.getKeyUsage();
             if (ku != null) {
                 int i = 0;
-                for (; i<ku.length; i++) {
+                int min_length = (ku.length < keyUsage.length) ? ku.length
+                        : keyUsage.length;
+                for (; i < min_length; i++) {
                     if (keyUsage[i] && !ku[i]) {
                         // the specified keyUsage allows,
                         // but certificate does not.



Mime
View raw message