diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-12-15 17:30:30 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-12-15 17:30:30 +0000 |
commit | b810f6f611ea50a9e8b84277e8a2fab4a820d64c (patch) | |
tree | c880bf40bee1b97a0b9b4bffe4aec46fe071ba5b /mandoc.c | |
parent | 2f6f855230bdab28ed6fddabb7af6dae42595746 (diff) | |
download | mandoc-b810f6f611ea50a9e8b84277e8a2fab4a820d64c.tar.gz mandoc-b810f6f611ea50a9e8b84277e8a2fab4a820d64c.tar.zst mandoc-b810f6f611ea50a9e8b84277e8a2fab4a820d64c.zip |
Catch localtime() failure for additional safety;
patch from Jan Stary <hans at stare dot cz> some time ago.
Diffstat (limited to 'mandoc.c')
-rw-r--r-- | mandoc.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $Id: mandoc.c,v 1.88 2014/10/28 13:24:44 schwarze Exp $ */ +/* $Id: mandoc.c,v 1.89 2014/12/15 17:30:30 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org> @@ -480,6 +480,8 @@ time2a(time_t t) int isz; tm = localtime(&t); + if (tm == NULL) + return(NULL); /* * Reserve space: |