diff options
author | 2015-02-07 16:39:44 +0000 | |
---|---|---|
committer | 2015-02-07 16:39:44 +0000 | |
commit | fba6afe971d5573c2d841f9891226b9c8e85fba5 (patch) | |
tree | fc355d2b428bbd00deae172e88ead34f90e14e26 /usr.bin/mandoc/mdoc_macro.c | |
parent | Update New Mexico area codes (the change happened in 2006). (diff) | |
download | wireguard-openbsd-fba6afe971d5573c2d841f9891226b9c8e85fba5.tar.xz wireguard-openbsd-fba6afe971d5573c2d841f9891226b9c8e85fba5.zip |
Closing a block validates it, which may end up deleting it,
so if we are in a loop over blocks, cleanly restart the loop
rather than risking use after free; found by jsg@ with afl.
Diffstat (limited to 'usr.bin/mandoc/mdoc_macro.c')
-rw-r--r-- | usr.bin/mandoc/mdoc_macro.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/mandoc/mdoc_macro.c b/usr.bin/mandoc/mdoc_macro.c index 4dcd103c929..a2fbde9f8e7 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.135 2015/02/06 07:12:34 schwarze Exp $ */ +/* $OpenBSD: mdoc_macro.c,v 1.136 2015/02/07 16:39:44 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2012-2015 Ingo Schwarze <schwarze@openbsd.org> @@ -939,6 +939,7 @@ blk_full(MACRO_PROT_ARGS) mdoc_macronames[tok], mdoc_macronames[n->tok]); rew_pending(mdoc, n); + n = mdoc->last; continue; case MDOC_It: /* Delay in case it's astray. */ |