diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2022-06-08 16:31:46 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2022-06-08 16:31:46 +0000 |
commit | 63bf683231aac42c3c172ff94de8bb5fa3d0a581 (patch) | |
tree | 21b8337bc9c3d6d122a64ce62350c628bd23d55c | |
parent | 88d09deb893505c936316537673cfbf30be47558 (diff) | |
download | mandoc-63bf683231aac42c3c172ff94de8bb5fa3d0a581.tar.gz mandoc-63bf683231aac42c3c172ff94de8bb5fa3d0a581.tar.zst mandoc-63bf683231aac42c3c172ff94de8bb5fa3d0a581.zip |
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@.
-rw-r--r-- | mdoc_validate.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c index a92d4077..c4c8aecf 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.390 2021/10/04 14:19:14 schwarze Exp $ */ +/* $Id: mdoc_validate.c,v 1.391 2022/06/08 16:31:46 schwarze Exp $ */ /* * Copyright (c) 2010-2021 Ingo Schwarze <schwarze@openbsd.org> * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> @@ -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; } |