summaryrefslogtreecommitdiffstats
path: root/mdoc_validate.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-12-18 20:15:56 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-12-18 20:15:56 +0000
commit85b953eae03a3f830784be84ad2e3e45c5bcf6e7 (patch)
tree859f236bd19a09260569c2765c0d3018210a138c /mdoc_validate.c
parent95d255dc4d21673d71bde36379df61e0f1a8b49f (diff)
downloadmandoc-85b953eae03a3f830784be84ad2e3e45c5bcf6e7.tar.gz
Only keep leading .Sm inside a list when it immediately precedes
the first .It. Otherwise, move it out together with whatever follows. Fixing an assertion failure found by jsg@ with afl.
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r--mdoc_validate.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c
index ed8c69dc..aece0c72 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1484,7 +1484,10 @@ post_bl(POST_ARGS)
nchild = nbody->child;
while (NULL != nchild) {
- if (MDOC_It == nchild->tok || MDOC_Sm == nchild->tok) {
+ if (nchild->tok == MDOC_It ||
+ (nchild->tok == MDOC_Sm &&
+ nchild->next != NULL &&
+ nchild->next->tok == MDOC_It)) {
nchild = nchild->next;
continue;
}