diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-08-19 17:28:58 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-08-19 17:28:58 +0000 |
commit | de5016a43a34e174728aa6da05dce5d7a9063fce (patch) | |
tree | 1f4c33a3b853367099b0eeb2ca8cb3d6892b631c /usr.bin/mandoc/mdoc_validate.c | |
parent | 51b70a5b7f48c000d4adf6b9a5146d66a5323346 (diff) |
Do not dereference a NULL pointer if a .Bl macro has
no -type, -width, -offset or -compact arguments whatsoever;
this got broken in mdoc_validate.c rev. 1.156.
While here, sort headers.
Diffstat (limited to 'usr.bin/mandoc/mdoc_validate.c')
-rw-r--r-- | usr.bin/mandoc/mdoc_validate.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/mandoc/mdoc_validate.c b/usr.bin/mandoc/mdoc_validate.c index fcca5e06f0a..0612989d5db 100644 --- a/usr.bin/mandoc/mdoc_validate.c +++ b/usr.bin/mandoc/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.161 2014/08/08 16:17:09 schwarze Exp $ */ +/* $Id: mdoc_validate.c,v 1.162 2014/08/19 17:28:57 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org> @@ -16,12 +16,12 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include <sys/types.h> #ifndef OSNAME #include <sys/utsname.h> #endif -#include <sys/types.h> - #include <assert.h> #include <ctype.h> #include <limits.h> @@ -528,7 +528,7 @@ pre_bl(PRE_ARGS) * ones. If we find no list type, we default to LIST_item. */ - wa = n->args->argv; + wa = (n->args == NULL) ? NULL : n->args->argv; mdoclt = MDOC_ARG_MAX; for (i = 0; n->args && i < (int)n->args->argc; i++) { argv = n->args->argv + i; |