diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-12-15 23:43:26 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-12-15 23:43:26 +0000 |
commit | 30ea145900ca3b0e27b62eb6f5efb69bd217753d (patch) | |
tree | 1c22aef1611d76cfaf65a222978959c1a7a39c93 | |
parent | 14d306440756a0231038d3e026f5869a27780735 (diff) | |
download | mandoc-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.
-rw-r--r-- | roff.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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': |