From 30ea145900ca3b0e27b62eb6f5efb69bd217753d Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 15 Dec 2014 23:43:26 +0000 Subject: 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. --- roff.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'roff.c') 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 * Copyright (c) 2010-2014 Ingo Schwarze @@ -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': -- cgit v1.2.3