source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Avoid out-of-bounds read access before the beginning of the
@ 2015-04-20  9:49 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2015-04-20  9:49 UTC (permalink / raw)
  To: source

Log Message:
-----------
Avoid out-of-bounds read access before the beginning of the 
mdoc_macros[] array.  This sometimes prevented proper warnings 
about text nodes preceding the first section header.

Modified Files:
--------------
    mdocml:
        mdoc_validate.c

Revision Data
-------------
Index: mdoc_validate.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mdoc_validate.c,v
retrieving revision 1.289
retrieving revision 1.290
diff -Lmdoc_validate.c -Lmdoc_validate.c -u -p -r1.289 -r1.290
--- mdoc_validate.c
+++ mdoc_validate.c
@@ -1562,7 +1562,8 @@ post_root(POST_ARGS)
 	/* Check that we begin with a proper `Sh'. */
 
 	n = mdoc->first->child;
-	while (n != NULL && mdoc_macros[n->tok].flags & MDOC_PROLOGUE)
+	while (n != NULL && n->tok != TOKEN_NONE &&
+	    mdoc_macros[n->tok].flags & MDOC_PROLOGUE)
 		n = n->next;
 
 	if (n == NULL)
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-04-20  9:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-20  9:49 mdocml: Avoid out-of-bounds read access before the beginning of the schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).