aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_validate.c
diff options
context:
space:
mode:
authorJoerg Sonnenberger <joerg@netbsd.org>2011-11-18 14:58:24 +0000
committerJoerg Sonnenberger <joerg@netbsd.org>2011-11-18 14:58:24 +0000
commitc19653d7011d627a0f86a886b70c153a99bd2684 (patch)
tree80376b297d5f6f98c69331dcb7a1593d68a27d2d /mdoc_validate.c
parente93722b2d89ae28d2016eb6021d60b235c94e276 (diff)
downloadmandoc-c19653d7011d627a0f86a886b70c153a99bd2684.tar.gz
mandoc-c19653d7011d627a0f86a886b70c153a99bd2684.tar.zst
mandoc-c19653d7011d627a0f86a886b70c153a99bd2684.zip
Bail out explicitly on invalid .Rs content like:
.Rs plain text .Re This avoids a crash on invalid.
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r--mdoc_validate.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c
index 56936424..bdf4a745 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_validate.c,v 1.177 2011/10/16 12:20:34 schwarze Exp $ */
+/* $Id: mdoc_validate.c,v 1.178 2011/11/18 14:58:24 joerg Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -1693,6 +1693,10 @@ post_rs(POST_ARGS)
mdoc_node_delete(mdoc, nn);
}
+ /* Bail out early if a plain text node is found inside .Rs. */
+ if (NULL == mdoc->last->child)
+ return(1);
+
/*
* The full `Rs' block needs special handling to order the
* sub-elements according to `rsord'. Pick through each element