aboutsummaryrefslogtreecommitdiff
path: root/crypto/openssh
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssh')
-rw-r--r--crypto/openssh/misc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/openssh/misc.c b/crypto/openssh/misc.c
index dd0bd032ae3c..1ed71646ebe4 100644
--- a/crypto/openssh/misc.c
+++ b/crypto/openssh/misc.c
@@ -2535,8 +2535,10 @@ format_absolute_time(uint64_t t, char *buf, size_t len)
time_t tt = t > SSH_TIME_T_MAX ? SSH_TIME_T_MAX : t;
struct tm tm;
- localtime_r(&tt, &tm);
- strftime(buf, len, "%Y-%m-%dT%H:%M:%S", &tm);
+ if (localtime_r(&tt, &tm) == NULL)
+ strlcpy(buf, "UNKNOWN-TIME", len);
+ else
+ strftime(buf, len, "%Y-%m-%dT%H:%M:%S", &tm);
}
/*