diff options
| author | 2015-04-29 14:48:17 +0000 | |
|---|---|---|
| committer | 2015-04-29 14:48:17 +0000 | |
| commit | ea701e045d0dc2d06177b40c5e50b6defafe424d (patch) | |
| tree | 5c2ff47f8896def56c6e0c239c73b4e0cc459911 /usr.bin/mandoc/mdoc_macro.c | |
| parent | When the last line of a table layout turns out to be empty, it is deleted. (diff) | |
| download | wireguard-openbsd-ea701e045d0dc2d06177b40c5e50b6defafe424d.tar.xz wireguard-openbsd-ea701e045d0dc2d06177b40c5e50b6defafe424d.zip | |
Do not mark a block with the MDOC_BROKEN flag if it merely contains
a mismatching explicit end macro without actually being broken.
Avoids a subsequent upward search for the non-existent breaker
ending up in a NULL pointer access; afl test case 005/Apr27 from jsg@.
Diffstat (limited to 'usr.bin/mandoc/mdoc_macro.c')
| -rw-r--r-- | usr.bin/mandoc/mdoc_macro.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/mandoc/mdoc_macro.c b/usr.bin/mandoc/mdoc_macro.c index bfebe2c2e7c..76ff2722d3d 100644 --- a/usr.bin/mandoc/mdoc_macro.c +++ b/usr.bin/mandoc/mdoc_macro.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mdoc_macro.c,v 1.151 2015/04/23 15:35:39 schwarze Exp $ */ +/* $OpenBSD: mdoc_macro.c,v 1.152 2015/04/29 14:48:17 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2012-2015 Ingo Schwarze <schwarze@openbsd.org> @@ -642,6 +642,8 @@ blk_exp_close(MACRO_PROT_ARGS) if (body == NULL) { mandoc_msg(MANDOCERR_BLK_NOTOPEN, mdoc->parse, line, ppos, mdoc_macronames[tok]); + if (later != NULL) + later->flags &= ~MDOC_BROKEN; if (maxargs && endbody == NULL) { /* * Stray .Ec without previous .Eo: |
