summaryrefslogtreecommitdiff
path: root/net-misc/wget/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-11-10 00:43:02 +0000
committerV3n3RiX <venerix@redcorelinux.org>2017-11-10 00:43:02 +0000
commita5332b59346f7cbf0fdbd148b54aa8a84aaf8190 (patch)
treee6d8d3589fcd01fbc3f1286185639163daa81424 /net-misc/wget/files
parentfceeaf01a28ee71065cf3798b70b77d3bc4ef199 (diff)
gentoo resync : 10.11.2017
Diffstat (limited to 'net-misc/wget/files')
-rw-r--r--net-misc/wget/files/wget-1.19.2-fix-segfault-due-to-derefencing-null-ptr.patch66
1 files changed, 66 insertions, 0 deletions
diff --git a/net-misc/wget/files/wget-1.19.2-fix-segfault-due-to-derefencing-null-ptr.patch b/net-misc/wget/files/wget-1.19.2-fix-segfault-due-to-derefencing-null-ptr.patch
new file mode 100644
index 000000000000..8a66e08c3e3b
--- /dev/null
+++ b/net-misc/wget/files/wget-1.19.2-fix-segfault-due-to-derefencing-null-ptr.patch
@@ -0,0 +1,66 @@
+From 973c26ed7d51052a7b6e120ed1b84e47266667e1 Mon Sep 17 00:00:00 2001
+From: Darshit Shah <darnir@gnu.org>
+Date: Mon, 6 Nov 2017 10:09:03 +0100
+Subject: Fix Segfault due to derefencing null ptr
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+* src/http.c(gethttp): When Encoding is gzip, ensure that the
+Content-Type Header was actually seen. Without this, the "type" variable
+is null causing a Segfault.
+
+Reported-By: Noël Köthe <noel@debian.org>
+---
+ src/http.c | 30 +++++++++++++++++++-----------
+ 1 file changed, 19 insertions(+), 11 deletions(-)
+
+diff --git a/src/http.c b/src/http.c
+index 9954848..2a5454f 100644
+--- a/src/http.c
++++ b/src/http.c
+@@ -3714,22 +3714,30 @@ gethttp (const struct url *u, struct url *original_url, struct http_stat *hs,
+ && opt.compression != compression_none)
+ {
+ /* Make sure the Content-Type is not gzip before decompressing */
+- const char * p = strchr (type, '/');
+- if (p == NULL)
+- {
+- hs->remote_encoding = ENC_GZIP;
+- hs->local_encoding = ENC_NONE;
+- }
+- else
++ if (type)
+ {
+- p++;
+- if (c_tolower(p[0]) == 'x' && p[1] == '-')
+- p += 2;
+- if (0 != c_strcasecmp (p, "gzip"))
++ const char * p = strchr (type, '/');
++ if (p == NULL)
+ {
+ hs->remote_encoding = ENC_GZIP;
+ hs->local_encoding = ENC_NONE;
+ }
++ else
++ {
++ p++;
++ if (c_tolower(p[0]) == 'x' && p[1] == '-')
++ p += 2;
++ if (0 != c_strcasecmp (p, "gzip"))
++ {
++ hs->remote_encoding = ENC_GZIP;
++ hs->local_encoding = ENC_NONE;
++ }
++ }
++ }
++ else
++ {
++ hs->remote_encoding = ENC_GZIP;
++ hs->local_encoding = ENC_NONE;
+ }
+ }
+ #endif
+--
+cgit v1.0-41-gc330
+