From: Nikos Mavrogiannopoulos Date: Tue, 16 Mar 2010 22:26:30 +0000 (+0100) Subject: Handle dates before 1-1-1970 (handle as being equal to 1-1-1970). X-Git-Tag: gnutls_2_9_10~47 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8a5918561dea2e7f831b1515294fa2ab0b7ddab3;p=thirdparty%2Fgnutls.git Handle dates before 1-1-1970 (handle as being equal to 1-1-1970). --- diff --git a/lib/x509/common.c b/lib/x509/common.c index f85e0ee4f9..f8fee2f563 100644 --- a/lib/x509/common.c +++ b/lib/x509/common.c @@ -458,6 +458,9 @@ _gnutls_x509_time2gtime (const char *ttime, int year) if (sizeof (time_t) <= 4 && etime.tm_year >= 2038) return (time_t) 2145914603; /* 2037-12-31 23:23:23 */ + if (etime.tm_year < 1970) + return (time_t) 0; + xx[2] = 0; /* get the month