From: schwarze Date: Mon, 15 Dec 2014 17:29:58 +0000 (+0000) Subject: Catch localtime() failure for additional safety; X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c21727c0c4c6e49a5196a270a9a4bc961fcb679e;p=openbsd Catch localtime() failure for additional safety; patch from Jan Stary some time ago. --- diff --git a/usr.bin/mandoc/mandoc.c b/usr.bin/mandoc/mandoc.c index 45793f1752c..16c4f026ee5 100644 --- a/usr.bin/mandoc/mandoc.c +++ b/usr.bin/mandoc/mandoc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mandoc.c,v 1.56 2014/11/28 19:25:03 schwarze Exp $ */ +/* $OpenBSD: mandoc.c,v 1.57 2014/12/15 17:29:58 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze @@ -475,6 +475,8 @@ time2a(time_t t) int isz; tm = localtime(&t); + if (tm == NULL) + return(NULL); /* * Reserve space: