diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2023-10-22 16:02:01 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2023-10-22 16:02:01 +0000 |
commit | 9e6e090ca7544bf35064fd24b38a45248c31af7b (patch) | |
tree | beb1a0c90c86bb23a154efeb60fe4c4168edab90 | |
parent | c198ddab2341ad8774cb270f30a515788ff66ecb (diff) | |
download | mandoc-9e6e090ca7544bf35064fd24b38a45248c31af7b.tar.gz |
While doing delayed expansion of escape sequences in macro arguments,
correctly check for failure of the in-place expansion function.
If an argument not only does recursive delayed expansion
but infinitely recursive delayed expansion, this bug could
result in an ESCAPE_EXPAND assertion failure.
Thanks to Eric van Gyzen <vangyzen at FreeBSD> for finding this bug
by inspecting FreeBSD source code.
-rw-r--r-- | roff.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1689,7 +1689,7 @@ roff_getarg(struct roff *r, char **cpp, int ln, int *pos) buf.buf = start; buf.sz = strlen(start) + 1; buf.next = NULL; - if (roff_expand(r, &buf, ln, 0, '\\') & ROFF_IGN) { + if (roff_expand(r, &buf, ln, 0, '\\') == ROFF_IGN) { free(buf.buf); buf.buf = mandoc_strdup(""); } |