6839886: Array overrun in pkcs11

Fix the wrong value when dealing w/ month and day.

Reviewed-by: mullan
This commit is contained in:
Valerie Peng 2011-12-21 14:08:00 -08:00
parent e4dad47833
commit 9b7ddf1602

View File

@ -374,7 +374,7 @@ CK_DATE * jDateObjectPtrToCKDatePtr(JNIEnv *env, jobject jDate)
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 @@ CK_DATE * jDateObjectPtrToCKDatePtr(JNIEnv *env, jobject jDate)
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);