]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Handle dates before 1-1-1970 (handle as being equal to 1-1-1970).
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Tue, 16 Mar 2010 22:26:30 +0000 (23:26 +0100)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Tue, 16 Mar 2010 22:45:15 +0000 (23:45 +0100)
lib/x509/common.c

index f85e0ee4f906f3ec890e36381926944353aa8943..f8fee2f563d748b064f423667d3322070fcc9ec8 100644 (file)
@@ -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