summaryrefslogtreecommitdiffstats
path: root/roff.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-12-15 23:43:26 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-12-15 23:43:26 +0000
commit52a3a69b975dd05a56837b3fc9f93cc8681d3282 (patch)
treee4d59e65ca298c5ced50ed4bae5d7b1ed0357e7f /roff.c
parent2322452bdd1d16bdfd654fff960ed6ecec3cbada (diff)
downloadmandoc-52a3a69b975dd05a56837b3fc9f93cc8681d3282.tar.gz
Empty conditions count as false.
When negated, they still count as false. Found when investigating crashes jsg@ found with afl. Not completely fixing the crashes yet.
Diffstat (limited to 'roff.c')
-rw-r--r--roff.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/roff.c b/roff.c
index 08a4f922..32cc6c31 100644
--- a/roff.c
+++ b/roff.c
@@ -1258,6 +1258,8 @@ roff_evalcond(struct roff *r, int ln, const char *v, int *pos)
wanttrue = 1;
switch (v[*pos]) {
+ case '\0':
+ return(0);
case 'n':
/* FALLTHROUGH */
case 'o':