asn1: Return a zeroed ASN1 time if gmtime_r() conversion fails
authorMartin Willi <martin@revosec.ch>
Tue, 15 Oct 2013 14:11:19 +0000 (16:11 +0200)
committerMartin Willi <martin@revosec.ch>
Wed, 4 Jun 2014 13:52:58 +0000 (15:52 +0200)
src/libstrongswan/asn1/asn1.c

index 38a6ad6..05be574 100644 (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