From 63bf683231aac42c3c172ff94de8bb5fa3d0a581 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Wed, 8 Jun 2022 16:31:46 +0000 Subject: 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 on bugs@. --- mdoc_validate.c | 5 +++-- 1 file 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 * Copyright (c) 2008-2012 Kristaps Dzonsons @@ -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; } -- cgit v1.2.3-56-ge451