From 33c7bf866c059d2de7824023b724ed7c05fb684f Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Sun, 3 Apr 2011 10:11:25 +0000 Subject: If wlevel in mparse_alloc() is greater than MANDOCLEVEL_FATAL, we'll throw assertions due to per-file-error not being properly set in mmsg(). This is reasonable behaviour (we shouldn't be able to ignore FATAL after all). Thus, make sure wlevel is sanitised. --- read.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'read.c') diff --git a/read.c b/read.c index ac0b23be..9c222eb1 100644 --- a/read.c +++ b/read.c @@ -662,6 +662,8 @@ mparse_alloc(enum mparset inttype, enum mandoclevel wlevel, mandocmsg mmsg, void { struct mparse *curp; + assert(wlevel <= MANDOCLEVEL_FATAL); + curp = mandoc_calloc(1, sizeof(struct mparse)); curp->wlevel = wlevel; -- cgit