diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2017-07-31 16:14:10 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2017-07-31 16:14:10 +0000 |
commit | d41a68de8e563ec665662c6908538a9ca789db39 (patch) | |
tree | b4d96734cda76f0ae5ca915fadff793eb53152bf /tbl_term.c | |
parent | 8f670667f66c9cd558e335e8987b7e8d1faad4c4 (diff) | |
download | mandoc-d41a68de8e563ec665662c6908538a9ca789db39.tar.gz |
Ignore explicitly specified negative column widths rather than
wrapping around to huge numbers and risking memory exhaustion;
fixes Debian ps(1). Bug reported by Dr. Markus Waldeck.
Diffstat (limited to 'tbl_term.c')
-rw-r--r-- | tbl_term.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -51,7 +51,10 @@ static void tbl_word(struct termp *, const struct tbl_dat *); static size_t term_tbl_sulen(const struct roffsu *su, void *arg) { - return term_hen((const struct termp *)arg, su); + int i; + + i = term_hen((const struct termp *)arg, su); + return i > 0 ? i : 0; } static size_t |