Fix double free of iri->orig_url (#981778)

Signed-off-by: Tomas Hozza <thozza@redhat.com>
This commit is contained in:
Tomas Hozza 2013-07-10 13:56:44 +02:00
parent 304bab8af9
commit 6e386f437c
2 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,29 @@
From bdf2764457bef7c33be289b889ddf6df91773296 Mon Sep 17 00:00:00 2001
From: Tomas Hozza <thozza@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@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

View File

@ -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 <thozza@redhat.com> - 1.14-7
- Fix double free of iri->orig_url (#981778)
* Mon Jun 24 2013 Tomas Hozza <thozza@redhat.com> - 1.14-6
- add missing options accept-regex and reject-regex to man page
- fix errors in texi2pod introduced in Perl-5.18