summaryrefslogtreecommitdiffstats
path: root/mdoc_validate.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2022-06-08 16:31:46 +0000
committerIngo Schwarze <schwarze@openbsd.org>2022-06-08 16:31:46 +0000
commitef97690dfcfd09d21d5daa92be40c8679c8531d3 (patch)
treec79e4dd6a95f220b54647cf8bb27c26fa86db198 /mdoc_validate.c
parent8b67872465026c8a36f46c94ab7c3c9cf281ba79 (diff)
downloadmandoc-ef97690dfcfd09d21d5daa92be40c8679c8531d3.tar.gz
When looking for the next block to tag, we aren't interested in children
of the current block but really want the next block instead. This fixes a segfault reported by Evan Silberman <evan at jklol dot net> on bugs@.
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r--mdoc_validate.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c
index 11b48a2f..751aecf9 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1113,7 +1113,8 @@ post_tg(POST_ARGS)
/* Find the next node. */
n = mdoc->last;
for (nn = n; nn != NULL; nn = nn->parent) {
- if (nn->next != NULL) {
+ if (nn->type != ROFFT_HEAD && nn->type != ROFFT_BODY &&
+ nn->type != ROFFT_TAIL && nn->next != NULL) {
nn = nn->next;
break;
}