From 6e386f437cacfa7c125612cc5d9e62dc5c912967 Mon Sep 17 00:00:00 2001 From: Tomas Hozza Date: Jul 10 2013 11:56:44 +0000 Subject: Fix double free of iri->orig_url (#981778) Signed-off-by: Tomas Hozza --- diff --git a/wget-1.14-fix-double-free-of-iri-orig_url.patch b/wget-1.14-fix-double-free-of-iri-orig_url.patch new file mode 100644 index 0000000..9ad8195 --- /dev/null +++ b/wget-1.14-fix-double-free-of-iri-orig_url.patch @@ -0,0 +1,29 @@ +From bdf2764457bef7c33be289b889ddf6df91773296 Mon Sep 17 00:00:00 2001 +From: Tomas Hozza +Date: Wed, 10 Jul 2013 13:23:37 +0200 +Subject: [PATCH] Set iri->orig_url to NULL after free. + +Set iri->orig_url to NULL after free to prevent double +free in retrieve_url() and iri_free() when using IRI +and downloading site that redirects itself. + +Signed-off-by: Tomas Hozza +--- + src/retr.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/retr.c b/src/retr.c +index 6204839..66624dc 100644 +--- a/src/retr.c ++++ b/src/retr.c +@@ -838,6 +838,7 @@ retrieve_url (struct url * orig_parsed, const char *origurl, char **file, + iri->utf8_encode = opt.enable_iri; + set_content_encoding (iri, NULL); + xfree_null (iri->orig_url); ++ iri->orig_url = NULL; + + /* Now, see if this new location makes sense. */ + newloc_parsed = url_parse (mynewloc, &up_error_code, iri, true); +-- +1.8.3.1 + diff --git a/wget.spec b/wget.spec index 94f8574..b8845d0 100644 --- a/wget.spec +++ b/wget.spec @@ -1,7 +1,7 @@ Summary: A utility for retrieving files using the HTTP or FTP protocols Name: wget Version: 1.14 -Release: 6%{?dist} +Release: 7%{?dist} License: GPLv3+ Group: Applications/Internet Url: http://www.gnu.org/software/wget/ @@ -13,6 +13,7 @@ Patch3: wget-1.14-sslreadtimeout.patch Patch4: wget-1.14-manpage-tex5.patch Patch5: wget-1.14-add_missing_options_doc.patch Patch6: wget-1.14-texi2pod_error_perl518.patch +Patch7: wget-1.14-fix-double-free-of-iri-orig_url.patch Provides: webclient Provides: bundled(gnulib) @@ -38,6 +39,7 @@ support for Proxy servers, and configurability. %patch4 -p1 %patch5 -p1 %patch6 -p1 +%patch7 -p1 %build if pkg-config openssl ; then @@ -74,6 +76,9 @@ rm -rf $RPM_BUILD_ROOT %{_infodir}/* %changelog +* Wed Jul 10 2013 Tomas Hozza - 1.14-7 +- Fix double free of iri->orig_url (#981778) + * Mon Jun 24 2013 Tomas Hozza - 1.14-6 - add missing options accept-regex and reject-regex to man page - fix errors in texi2pod introduced in Perl-5.18