aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit30ea145900ca3b0e27b62eb6f5efb69bd217753d (patch)
tree1c22aef1611d76cfaf65a222978959c1a7a39c93 /roff.c
parent14d306440756a0231038d3e026f5869a27780735 (diff)
downloadmandoc-30ea145900ca3b0e27b62eb6f5efb69bd217753d.tar.gz
mandoc-30ea145900ca3b0e27b62eb6f5efb69bd217753d.tar.zst
mandoc-30ea145900ca3b0e27b62eb6f5efb69bd217753d.zip
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.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/roff.c b/roff.c
index f44f01f1..669a1cdb 100644
--- a/roff.c
+++ b/roff.c
@@ -1,4 +1,4 @@
-/* $Id: roff.c,v 1.239 2014/11/19 01:20:25 schwarze Exp $ */
+/* $Id: roff.c,v 1.240 2014/12/15 23:43:26 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -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':