asn1: Return a zeroed ASN1 time if gmtime_r() conversion fails

This commit is contained in:
Martin Willi
2014-06-04 15:52:58 +02:00
parent 8f129319ff
commit a4719c5767
+1 -1
View File
@@ -460,7 +460,7 @@ chunk_t asn1_from_time(const time_t *time, asn1_t type)
const char *format;
char buf[BUF_LEN];
chunk_t formatted_time;
struct tm t;
struct tm t = {};
gmtime_r(time, &t);
/* RFC 5280 says that dates through the year 2049 MUST be encoded as UTCTIME