6839886: Array overrun in pkcs11
authorvaleriep
Wed, 21 Dec 2011 14:08:00 -0800
changeset 11356 898d37526be1
parent 11355 c2cb710f1bdd
child 11357 0ef20e50a018
6839886: Array overrun in pkcs11 Summary: Fix the wrong value when dealing w/ month and day. Reviewed-by: mullan
jdk/src/share/native/sun/security/pkcs11/wrapper/p11_convert.c
--- a/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_convert.c	Wed Dec 21 10:06:32 2011 +0000
+++ b/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_convert.c	Wed Dec 21 14:08:00 2011 -0800
@@ -374,7 +374,7 @@
             return NULL;
         }
 
-        for (i = 0; (i < ckLength) && (i < 4) ; i++) {
+        for (i = 0; (i < ckLength) && (i < 2) ; i++) {
             ckpDate->month[i] = jCharToCKChar(jTempChars[i]);
         }
         free(jTempChars);
@@ -398,7 +398,7 @@
             return NULL;
         }
 
-        for (i = 0; (i < ckLength) && (i < 4) ; i++) {
+        for (i = 0; (i < ckLength) && (i < 2) ; i++) {
             ckpDate->day[i] = jCharToCKChar(jTempChars[i]);
         }
         free(jTempChars);