aboutsummaryrefslogtreecommitdiffstats
path: root/debian/patches/955_tbl-indent.patch
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2018-01-26 09:46:30 +0000
committerTatsuya Kinoshita <tats@debian.org>2018-01-26 09:46:30 +0000
commit70dc2f8597b230ec731e9cbe07b1ee619f580355 (patch)
tree8c2adf0485c74faa037c502aa8258ded9c27c886 /debian/patches/955_tbl-indent.patch
parentDebian release 0.5.3-34 (diff)
downloadw3m-70dc2f8597b230ec731e9cbe07b1ee619f580355.tar.gz
w3m-70dc2f8597b230ec731e9cbe07b1ee619f580355.zip
New patch 955_tbl-indent.patch to fix stack overflow [CVE-2018-6196]
Diffstat (limited to '')
-rw-r--r--debian/patches/955_tbl-indent.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/debian/patches/955_tbl-indent.patch b/debian/patches/955_tbl-indent.patch
new file mode 100644
index 0000000..9252669
--- /dev/null
+++ b/debian/patches/955_tbl-indent.patch
@@ -0,0 +1,24 @@
+Subject: Prevent negative indent value in feed_table_block_tag()
+From: Tatsuya Kinoshita <tats@debian.org>
+Bug-Debian: https://github.com/tats/w3m/issues/88 [CVE-2018-6196]
+Origin: https://salsa.debian.org/debian/w3m/commit/8354763b90490d4105695df52674d0fcef823e92
+
+diff --git a/table.c b/table.c
+index 221db92..4f193e1 100644
+--- a/table.c
++++ b/table.c
+@@ -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);