summaryrefslogtreecommitdiff
path: root/lib/x509/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/x509/common.c')
-rw-r--r--lib/x509/common.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/x509/common.c b/lib/x509/common.c
index 53cae80c06..dea8c03b96 100644
--- a/lib/x509/common.c
+++ b/lib/x509/common.c
@@ -706,6 +706,11 @@ gtime2generalTime(time_t gtime, char *str_time, size_t str_time_size)
{
size_t ret;
struct tm _tm;
+
+ if (gtime == (time_t)-1) {
+ snprintf(str_time, str_time_size, "99991231235959Z");
+ return 0;
+ }
if (!gmtime_r(&gtime, &_tm)) {
gnutls_assert();