Don't use clobbered 'i' for checking UTCTime and GeneralizedTime length.
This commit is contained in:
parent
d40a1b865f
commit
5947ca0409
@ -370,7 +370,7 @@ int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm)
|
|||||||
d= (v[6]-'0')*10+(v[7]-'0');
|
d= (v[6]-'0')*10+(v[7]-'0');
|
||||||
h= (v[8]-'0')*10+(v[9]-'0');
|
h= (v[8]-'0')*10+(v[9]-'0');
|
||||||
m= (v[10]-'0')*10+(v[11]-'0');
|
m= (v[10]-'0')*10+(v[11]-'0');
|
||||||
if (i >= 14 &&
|
if (tm->length >= 14 &&
|
||||||
(v[12] >= '0') && (v[12] <= '9') &&
|
(v[12] >= '0') && (v[12] <= '9') &&
|
||||||
(v[13] >= '0') && (v[13] <= '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');
|
d= (v[4]-'0')*10+(v[5]-'0');
|
||||||
h= (v[6]-'0')*10+(v[7]-'0');
|
h= (v[6]-'0')*10+(v[7]-'0');
|
||||||
m= (v[8]-'0')*10+(v[9]-'0');
|
m= (v[8]-'0')*10+(v[9]-'0');
|
||||||
if (i >=12 &&
|
if (tm->length >=12 &&
|
||||||
(v[10] >= '0') && (v[10] <= '9') &&
|
(v[10] >= '0') && (v[10] <= '9') &&
|
||||||
(v[11] >= '0') && (v[11] <= '9'))
|
(v[11] >= '0') && (v[11] <= '9'))
|
||||||
s= (v[10]-'0')*10+(v[11]-'0');
|
s= (v[10]-'0')*10+(v[11]-'0');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user