[wget/f18] Fix double free of iri->orig_url (#981778)

Tomas Hozza thozza at fedoraproject.org
Wed Jul 10 12:23:07 UTC 2013


commit 9fdf35ca18921b3b34e307570fa8c01299dca69f
Author: Tomas Hozza <thozza at redhat.com>
Date:   Wed Jul 10 13:56:44 2013 +0200

    Fix double free of iri->orig_url (#981778)
    
    Signed-off-by: Tomas Hozza <thozza at redhat.com>

 wget-1.14-fix-double-free-of-iri-orig_url.patch |   29 +++++++++++++++++++++++
 wget.spec                                       |    7 ++++-
 2 files changed, 35 insertions(+), 1 deletions(-)
---
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 <thozza at redhat.com>
+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 <thozza at redhat.com>
+---
+ 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 eadcf19..ebd4905 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: 3%{?dist}
+Release: 4%{?dist}
 License: GPLv3+
 Group: Applications/Internet
 Url: http://www.gnu.org/software/wget/
@@ -10,6 +10,7 @@ Source: ftp://ftp.gnu.org/gnu/wget/wget-%{version}.tar.xz
 Patch1: wget-rh-modified.patch
 Patch2: wget-1.12-path.patch
 Patch3: wget-1.14-sslreadtimeout.patch
+Patch4: wget-1.14-fix-double-free-of-iri-orig_url.patch
 
 Provides: webclient
 Provides: bundled(gnulib) 
@@ -32,6 +33,7 @@ support for Proxy servers, and configurability.
 %patch1 -p0
 %patch2 -p1
 %patch3 -p1 -b .sslreadtimeout
+%patch4 -p1
 
 %build
 if pkg-config openssl ; then
@@ -68,6 +70,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_infodir}/*
 
 %changelog
+* Wed Jul 10 2013 Tomas Hozza <thozza at redhat.com> - 1.14-4
+- Fix double free of iri->orig_url (#981778)
+
 * Thu Oct 11 2012 Tomas Hozza <thozza at redhat.com> 1.14-3
 - Added libuuid-devel to BuildRequires to use libuuid functions
   in "src/warc.c" functions (#865421)


More information about the scm-commits mailing list