changeset 4879:a9dfdc523c2c

6839886: Array overrun in pkcs11 Summary: Fix the wrong value when dealing w/ month and day. Reviewed-by: mullan
author valeriep
date Wed, 21 Dec 2011 14:08:00 -0800
parents b1814b3ea6d3
children 11698dedbe79
files src/share/native/sun/security/pkcs11/wrapper/p11_convert.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/native/sun/security/pkcs11/wrapper/p11_convert.c	Wed Dec 21 10:06:32 2011 +0000
+++ b/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);