diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2022-06-08 16:29:13 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2022-06-08 16:29:13 +0000 |
commit | 9a613290c433007a8825d8e8f96e47b9486cf94c (patch) | |
tree | e8002d2fde5520c039cca461c047593edb5a9996 /usr.bin/mandoc/mdoc_validate.c | |
parent | 5a0909c5c7652f1c72210a7584efefb0c8149b1f (diff) |
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 'usr.bin/mandoc/mdoc_validate.c')
-rw-r--r-- | usr.bin/mandoc/mdoc_validate.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/mandoc/mdoc_validate.c b/usr.bin/mandoc/mdoc_validate.c index 9e681af4b50..aa47566638a 100644 --- a/usr.bin/mandoc/mdoc_validate.c +++ b/usr.bin/mandoc/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mdoc_validate.c,v 1.305 2021/10/04 14:18:42 schwarze Exp $ */ +/* $OpenBSD: mdoc_validate.c,v 1.306 2022/06/08 16:29:12 schwarze Exp $ */ /* * Copyright (c) 2010-2021 Ingo Schwarze <schwarze@openbsd.org> * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> @@ -1098,7 +1098,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; } |