aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2016-11-21 15:19:50 +0000
committerTatsuya Kinoshita <tats@debian.org>2016-11-21 15:19:50 +0000
commitaa1627b916ce8f6b533cc7442eff84e0828486f6 (patch)
tree6af622fcc5bd90b6bf7505d406afdb3ae7558d3b
parentNew patch 930_tbl-mode.patch to fix null deref (diff)
downloadw3m-aa1627b916ce8f6b533cc7442eff84e0828486f6.tar.gz
w3m-aa1627b916ce8f6b533cc7442eff84e0828486f6.zip
New patch 931_parse-url.patch to fix global-buffer-overflow
-rw-r--r--debian/patches/931_parse-url.patch21
-rw-r--r--debian/patches/series1
2 files changed, 22 insertions, 0 deletions
diff --git a/debian/patches/931_parse-url.patch b/debian/patches/931_parse-url.patch
new file mode 100644
index 0000000..f7de9f5
--- /dev/null
+++ b/debian/patches/931_parse-url.patch
@@ -0,0 +1,21 @@
+Subject: Prevent global-buffer-overflow in parseURL()
+Author: Tatsuya Kinoshita <tats@debian.org>
+Bug-Debian: https://github.com/tats/w3m/issues/41
+Origin: https://anonscm.debian.org/cgit/collab-maint/w3m.git/commit/?id=ba9d78faeba9024c3e8840579c3b0e959ae2cb0f
+
+diff --git a/url.c b/url.c
+index 10089ca..fc213da 100644
+--- a/url.c
++++ b/url.c
+@@ -841,7 +841,10 @@ parseURL(char *url, ParsedURL *p_url, ParsedURL *current)
+ case '#':
+ p_url->host = copyPath(q, p - q,
+ COPYPATH_SPC_IGNORE | COPYPATH_LOWERCASE);
+- p_url->port = DefaultPort[p_url->scheme];
++ if (p_url->scheme != SCM_UNKNOWN)
++ p_url->port = DefaultPort[p_url->scheme];
++ else
++ p_url->port = 0;
+ break;
+ }
+ analyze_file:
diff --git a/debian/patches/series b/debian/patches/series
index 3db0170..3acd91e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -66,3 +66,4 @@
928_form-id.patch
929_anchor.patch
930_tbl-mode.patch
+931_parse-url.patch