From: schwarze Date: Sun, 28 Aug 2016 16:13:51 +0000 (+0000) Subject: If a line inside .Bl -column starts with a tab character X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=eca553ad5994505ec70738c6ef85bc956061d253;p=openbsd If a line inside .Bl -column starts with a tab character and there was no preceding .It macro, do not read the byte before the beginning of the line buffer. Found by tb@ with afl@. --- diff --git a/usr.bin/mandoc/mdoc_argv.c b/usr.bin/mandoc/mdoc_argv.c index 4ea7b4d1f5d..705256c3ead 100644 --- a/usr.bin/mandoc/mdoc_argv.c +++ b/usr.bin/mandoc/mdoc_argv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mdoc_argv.c,v 1.64 2016/07/15 18:02:32 schwarze Exp $ */ +/* $OpenBSD: mdoc_argv.c,v 1.65 2016/08/28 16:13:51 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2012, 2014, 2015 Ingo Schwarze @@ -478,7 +478,7 @@ args(struct roff_man *mdoc, int line, int *pos, * unless there is a blank in between. */ - if (p[-1] != ' ') + if (p > buf && p[-1] != ' ') mdoc->flags |= MDOC_PHRASEQL; if (p[1] != ' ') mdoc->flags |= MDOC_PHRASEQN;