diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2008-11-05 18:28:24 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2008-11-05 18:28:24 +0000 |
commit | 5947ca0409c2ac3663972ba68d223cd02ade2b49 (patch) | |
tree | a839744c81b245002bb478e68bd316c36e5c5b6b /crypto/asn1/t_x509.c | |
parent | d40a1b865fddc3d67f8c06ff1f1466fad331c8f7 (diff) | |
download | openssl-5947ca0409c2ac3663972ba68d223cd02ade2b49.tar.gz |
Don't use clobbered 'i' for checking UTCTime and GeneralizedTime length.
Diffstat (limited to 'crypto/asn1/t_x509.c')
-rw-r--r-- | crypto/asn1/t_x509.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/asn1/t_x509.c b/crypto/asn1/t_x509.c index 7d22e1c0ce..e504d50d50 100644 --- a/crypto/asn1/t_x509.c +++ b/crypto/asn1/t_x509.c @@ -370,7 +370,7 @@ int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) d= (v[6]-'0')*10+(v[7]-'0'); h= (v[8]-'0')*10+(v[9]-'0'); m= (v[10]-'0')*10+(v[11]-'0'); - if (i >= 14 && + if (tm->length >= 14 && (v[12] >= '0') && (v[12] <= '9') && (v[13] >= '0') && (v[13] <= '9')) { @@ -417,7 +417,7 @@ int ASN1_UTCTIME_print(BIO *bp, const ASN1_UTCTIME *tm) d= (v[4]-'0')*10+(v[5]-'0'); h= (v[6]-'0')*10+(v[7]-'0'); m= (v[8]-'0')*10+(v[9]-'0'); - if (i >=12 && + if (tm->length >=12 && (v[10] >= '0') && (v[10] <= '9') && (v[11] >= '0') && (v[11] <= '9')) s= (v[10]-'0')*10+(v[11]-'0'); |