6839886: Array overrun in pkcs11
Summary: Fix the wrong value when dealing w/ month and day.
Reviewed-by: mullan
--- 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);