diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2019-07-06 20:05:27 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2019-07-06 20:05:27 +0000 |
commit | eb0b093cc0ab8e91f19a1669f8c2961b907a4b04 (patch) | |
tree | 4032bfffed803a867f2cb6c36ec4872d65dbb57c /main.c | |
parent | 239b9224e5994ae6c12d8238086eb5c354364667 (diff) | |
download | mandoc-eb0b093cc0ab8e91f19a1669f8c2961b907a4b04.tar.gz mandoc-eb0b093cc0ab8e91f19a1669f8c2961b907a4b04.tar.zst mandoc-eb0b093cc0ab8e91f19a1669f8c2961b907a4b04.zip |
prevent mandoc from segfaulting if /tmp is not writable;
patch from espie@
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.327 2019/05/03 18:39:34 schwarze Exp $ */ +/* $Id: main.c,v 1.328 2019/07/06 20:05:27 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2012, 2014-2019 Ingo Schwarze <schwarze@openbsd.org> @@ -504,7 +504,8 @@ main(int argc, char *argv[]) if (argc < 1) { if (use_pager) { tag_files = tag_init(); - tag_files->tagname = conf.output.tag; + if (tag_files != NULL) + tag_files->tagname = conf.output.tag; } thisarg = "<stdin>"; mandoc_msg_setinfilename(thisarg); @@ -542,7 +543,8 @@ main(int argc, char *argv[]) if (use_pager) { use_pager = 0; tag_files = tag_init(); - tag_files->tagname = conf.output.tag; + if (tag_files != NULL) + tag_files->tagname = conf.output.tag; } mandoc_msg_setinfilename(thisarg); |