diff options
Diffstat (limited to 'src/lib/libcrypto/asn1/a_time.c')
-rw-r--r-- | src/lib/libcrypto/asn1/a_time.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/libcrypto/asn1/a_time.c b/src/lib/libcrypto/asn1/a_time.c index 27ddd30899..7348da9457 100644 --- a/src/lib/libcrypto/asn1/a_time.c +++ b/src/lib/libcrypto/asn1/a_time.c | |||
@@ -105,7 +105,10 @@ ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t) | |||
105 | 105 | ||
106 | ts=OPENSSL_gmtime(&t,&data); | 106 | ts=OPENSSL_gmtime(&t,&data); |
107 | if (ts == NULL) | 107 | if (ts == NULL) |
108 | { | ||
109 | ASN1err(ASN1_F_ASN1_TIME_SET, ASN1_R_ERROR_GETTING_TIME); | ||
108 | return NULL; | 110 | return NULL; |
111 | } | ||
109 | if((ts->tm_year >= 50) && (ts->tm_year < 150)) | 112 | if((ts->tm_year >= 50) && (ts->tm_year < 150)) |
110 | return ASN1_UTCTIME_set(s, t); | 113 | return ASN1_UTCTIME_set(s, t); |
111 | return ASN1_GENERALIZEDTIME_set(s,t); | 114 | return ASN1_GENERALIZEDTIME_set(s,t); |
@@ -152,7 +155,7 @@ ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZE | |||
152 | if (t->data[0] >= '5') strcpy(str, "19"); | 155 | if (t->data[0] >= '5') strcpy(str, "19"); |
153 | else strcpy(str, "20"); | 156 | else strcpy(str, "20"); |
154 | 157 | ||
155 | strcat(str, (char *)t->data); | 158 | BUF_strlcat(str, (char *)t->data, t->length+3); /* Include space for a '\0' */ |
156 | 159 | ||
157 | return ret; | 160 | return ret; |
158 | } | 161 | } |