diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2018-01-25 16:03:19 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2018-01-26 09:40:18 +0000 |
commit | ee0bdf055ed842c464b805305da8949657bfa3ff (patch) | |
tree | 3bf9e692a0962bdf9643ff7d86c1f41beab03003 | |
parent | Update ChangeLog (diff) | |
download | w3m-ee0bdf055ed842c464b805305da8949657bfa3ff.tar.gz w3m-ee0bdf055ed842c464b805305da8949657bfa3ff.zip |
Prevent negative indent value in feed_table_block_tag()
Bug-Debian: https://github.com/tats/w3m/issues/88 [CVE-2018-6196]
-rw-r--r-- | table.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -2356,10 +2356,14 @@ feed_table_block_tag(struct table *tbl, if (mode->indent_level < MAX_INDENT_LEVEL) tbl->indent -= INDENT_INCR; } + if (tbl->indent < 0) + tbl->indent = 0; offset = tbl->indent; if (cmd == HTML_DT) { if (mode->indent_level > 0 && mode->indent_level <= MAX_INDENT_LEVEL) offset -= INDENT_INCR; + if (offset < 0) + offset = 0; } if (tbl->indent > 0) { check_minimum0(tbl, 0); |