diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2017-03-03 11:50:49 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2017-03-03 11:50:49 +0000 |
commit | 0bd8e44683c8ada83b23a5f329ef7adf81779d00 (patch) | |
tree | 0e81d29fa8d71ba8e976ee9e2b9fa067f131a209 /roff.c | |
parent | 20b0938b1da4fd3f51912c4fff9da73b327b9586 (diff) | |
download | mandoc-0bd8e44683c8ada83b23a5f329ef7adf81779d00.tar.gz |
Fix previous: do not access the byte before the string if the string
is empty; found by jsg@ with afl(1).
Diffstat (limited to 'roff.c')
-rw-r--r-- | roff.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1236,7 +1236,7 @@ deroff(char **dest, const struct roff_node *n) /* Skip trailing backslash. */ sz = strlen(cp); - if (cp[sz - 1] == '\\') + if (sz > 0 && cp[sz - 1] == '\\') sz--; /* Skip trailing whitespace. */ |