=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc_validate.c,v retrieving revision 1.267 retrieving revision 1.268 diff -u -r1.267 -r1.268 --- src/usr.bin/mandoc/mdoc_validate.c 2017/08/02 13:28:35 1.267 +++ src/usr.bin/mandoc/mdoc_validate.c 2017/09/12 18:20:32 1.268 @@ -1,4 +1,4 @@ -/* $OpenBSD: mdoc_validate.c,v 1.267 2017/08/02 13:28:35 schwarze Exp $ */ +/* $OpenBSD: mdoc_validate.c,v 1.268 2017/09/12 18:20:32 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2017 Ingo Schwarze @@ -1899,7 +1899,10 @@ arch++; if (*arch == NULL) { n = mdoc->first->child; - while (n->tok != MDOC_Dt) + while (n->tok != MDOC_Dt || + n->child == NULL || + n->child->next == NULL || + n->child->next->next == NULL) n = n->next; n = n->child->next->next; mandoc_vmsg(MANDOCERR_ARCH_BAD,