diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-02-11 14:15:12 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-02-11 14:15:12 +0000 |
commit | a5ec4b155fd2b5756e3494144f8347f3ad03d4c1 (patch) | |
tree | a0b8e1637976da0d65a31f32be1f180875f7ef8d /mdoc_html.c | |
parent | ac2fcf5a79f33c981e28a5af1816f1f29d7a0be5 (diff) | |
download | mandoc-a5ec4b155fd2b5756e3494144f8347f3ad03d4c1.tar.gz |
do not access a NULL pointer if an .Eo block lacks a tail;
found by jsg@ with afl, test case #16
Diffstat (limited to 'mdoc_html.c')
-rw-r--r-- | mdoc_html.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/mdoc_html.c b/mdoc_html.c index 3d699e61..067cfabd 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -2220,9 +2220,8 @@ mdoc_eo_pre(MDOC_ARGS) n->child->end != ENDBODY_NOT) print_text(h, "\\&"); else if (n->end != ENDBODY_NOT ? n->child != NULL : - n->parent->head->child != NULL && - (n->parent->body->child != NULL || - n->parent->tail->child != NULL)) + n->parent->head->child != NULL && (n->child != NULL || + (n->parent->tail != NULL && n->parent->tail->child != NULL))) h->flags |= HTML_NOSPACE; return(1); } |