From b810f6f611ea50a9e8b84277e8a2fab4a820d64c Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 15 Dec 2014 17:30:30 +0000 Subject: Catch localtime() failure for additional safety; patch from Jan Stary some time ago. --- mandoc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mandoc.c') diff --git a/mandoc.c b/mandoc.c index 2ec179ea..cd26ff29 100644 --- a/mandoc.c +++ b/mandoc.c @@ -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 * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze @@ -480,6 +480,8 @@ time2a(time_t t) int isz; tm = localtime(&t); + if (tm == NULL) + return(NULL); /* * Reserve space: -- cgit v1.2.3-56-ge451