summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/mdoc.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2010-03-25 02:02:29 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2010-03-25 02:02:29 +0000
commit101ad9b36b44c7e4fb373480c7b855d39e8bcdc5 (patch)
treec41afa875ec26aca91c3b5fd9b58667c793f27ff /usr.bin/mandoc/mdoc.c
parentae5942fb90832e590bf2608a43c4f2717f012cd8 (diff)
fix a stupid out-of-bounds read access introduced in the previous
revision, in the code searching for the end of a sentence
Diffstat (limited to 'usr.bin/mandoc/mdoc.c')
-rw-r--r--usr.bin/mandoc/mdoc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/mandoc/mdoc.c b/usr.bin/mandoc/mdoc.c
index 707f9bd6364..860a6c21873 100644
--- a/usr.bin/mandoc/mdoc.c
+++ b/usr.bin/mandoc/mdoc.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc.c,v 1.35 2010/03/02 00:38:59 schwarze Exp $ */
+/* $Id: mdoc.c,v 1.36 2010/03/25 02:02:28 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -756,7 +756,7 @@ parsemacro(struct mdoc *m, int ln, char *buf)
n = n->next;
if (MDOC_TEXT == n->type && m->last->parent->tok != MDOC_Rs) {
t = n->string;
- while (t && t[1])
+ while (t[0] && t[1])
t++;
if ('.' == *t || '!' == *t || '?' == *t) {
if ( ! mdoc_elem_alloc(m, ln, i, MDOC_eos, NULL))