diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-10-30 18:53:54 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-10-30 18:53:54 +0000 |
commit | bd1ba68e6adefe4522546f09c18b0e8f7e0326ab (patch) | |
tree | 0d0782b03b9586659a5ce84661325036721e6497 /mdoc_state.c | |
parent | b4d8740f1d509928595104ff1a6e6b3deb72f981 (diff) | |
download | mandoc-bd1ba68e6adefe4522546f09c18b0e8f7e0326ab.tar.gz |
Do not access a NULL pointer when a .Bd macro has no arguments at all.
Bug reported by krw@.
Diffstat (limited to 'mdoc_state.c')
-rw-r--r-- | mdoc_state.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mdoc_state.c b/mdoc_state.c index 849ea43e..cd5d6ca8 100644 --- a/mdoc_state.c +++ b/mdoc_state.c @@ -195,6 +195,9 @@ state_bd(STATE_ARGS) (n->type != ROFFT_BODY || n->end != ENDBODY_NOT)) return; + if (n->parent->args == NULL) + return; + arg = n->parent->args->argv[0].arg; if (arg != MDOC_Literal && arg != MDOC_Unfilled) return; |