diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-04-03 10:11:25 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-04-03 10:11:25 +0000 |
commit | 33c7bf866c059d2de7824023b724ed7c05fb684f (patch) | |
tree | 2b9a56399458c0e9e77d67fbca97b9c9e0f149b1 /read.c | |
parent | 30823ed848f6fdfe70dedc3207ffad3e075dc51a (diff) | |
download | mandoc-33c7bf866c059d2de7824023b724ed7c05fb684f.tar.gz |
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.
Diffstat (limited to 'read.c')
-rw-r--r-- | read.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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; |