summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-12-15 17:30:30 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-12-15 17:30:30 +0000
commite6b080f3a27c56f233170a65580fb5d2f5a9841c (patch)
tree178666e4748c9d39116ea2d024f45590bec8621f
parent812f665d4bac40245447d88e6f1542df89108629 (diff)
downloadmandoc-e6b080f3a27c56f233170a65580fb5d2f5a9841c.tar.gz
Catch localtime() failure for additional safety;
patch from Jan Stary <hans at stare dot cz> some time ago.
-rw-r--r--mandoc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mandoc.c b/mandoc.c
index f74e32a7..3ae01d66 100644
--- a/mandoc.c
+++ b/mandoc.c
@@ -480,6 +480,8 @@ time2a(time_t t)
int isz;
tm = localtime(&t);
+ if (tm == NULL)
+ return(NULL);
/*
* Reserve space: