From a5332b59346f7cbf0fdbd148b54aa8a84aaf8190 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 10 Nov 2017 00:43:02 +0000 Subject: gentoo resync : 10.11.2017 --- ...-fix-segfault-due-to-derefencing-null-ptr.patch | 66 ++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 net-misc/wget/files/wget-1.19.2-fix-segfault-due-to-derefencing-null-ptr.patch (limited to 'net-misc/wget/files') 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 +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 +--- + 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 + -- cgit v1.2.3