From 3c22017d44ec5f10dd1ac44fa3954867a010ae50 Mon Sep 17 00:00:00 2001 From: David King Date: Fri, 4 May 2018 09:42:50 +0100 Subject: [PATCH] Resurrect an old patch (#1459779) --- libproxy-0.4.11-crash.patch | 41 ++++++++++++++++++++++++++++++ libproxy-pacrunner-crash-fix.patch | 12 --------- libproxy.spec | 7 +++-- 3 files changed, 46 insertions(+), 14 deletions(-) create mode 100644 libproxy-0.4.11-crash.patch delete mode 100644 libproxy-pacrunner-crash-fix.patch diff --git a/libproxy-0.4.11-crash.patch b/libproxy-0.4.11-crash.patch new file mode 100644 index 0000000..ed9f1a9 --- /dev/null +++ b/libproxy-0.4.11-crash.patch @@ -0,0 +1,41 @@ +diff -up libproxy-0.4.11/libproxy/extension_pacrunner.cpp.crash libproxy-0.4.11/libproxy/extension_pacrunner.cpp +--- libproxy-0.4.11/libproxy/extension_pacrunner.cpp.crash 2010-07-29 08:14:59.000000000 -0400 ++++ libproxy-0.4.11/libproxy/extension_pacrunner.cpp 2013-11-11 15:23:56.987266457 -0500 +@@ -22,20 +22,10 @@ using namespace libproxy; + + pacrunner::pacrunner(string, const url&) {} + +-pacrunner_extension::pacrunner_extension() { +- this->pr = NULL; +-} ++pacrunner_extension::pacrunner_extension() {} + +-pacrunner_extension::~pacrunner_extension() { +- if (this->pr) delete this->pr; +-} ++pacrunner_extension::~pacrunner_extension() {} + + pacrunner* pacrunner_extension::get(string pac, const url& pacurl) throw (bad_alloc) { +- if (this->pr) { +- if (this->last == pac) +- return this->pr; +- delete this->pr; +- } +- +- return this->pr = this->create(pac, pacurl); ++ return this->create(pac, pacurl); + } +diff -up libproxy-0.4.11/libproxy/proxy.cpp.crash libproxy-0.4.11/libproxy/proxy.cpp +--- libproxy-0.4.11/libproxy/proxy.cpp.crash 2013-11-11 15:25:27.309271353 -0500 ++++ libproxy-0.4.11/libproxy/proxy.cpp 2013-11-11 15:25:31.569271584 -0500 +@@ -416,7 +416,9 @@ void proxy_factory::run_pac(url &realurl + + /* Run the PAC, but only try one PACRunner */ + if (debug) cerr << "Using pacrunner: " << typeid(*pacrunners[0]).name() << endl; +- string pacresp = pacrunners[0]->get(this->pac, this->pacurl->to_string())->run(realurl); ++ pacrunner* runner = pacrunners[0]->get(this->pac, this->pacurl->to_string()); ++ string pacresp = runner->run(realurl); ++ delete runner; + if (debug) cerr << "Pacrunner returned: " << pacresp << endl; + format_pac_response(pacresp, response); + } diff --git a/libproxy-pacrunner-crash-fix.patch b/libproxy-pacrunner-crash-fix.patch deleted file mode 100644 index b9ea8ab..0000000 --- a/libproxy-pacrunner-crash-fix.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up libproxy-0.4.11/libproxy/extension_pacrunner.cpp.mozjscrash libproxy-0.4.11/libproxy/extension_pacrunner.cpp ---- libproxy-0.4.11/libproxy/extension_pacrunner.cpp.mozjscrash 2010-07-29 08:14:59.000000000 -0400 -+++ libproxy-0.4.11/libproxy/extension_pacrunner.cpp 2013-09-19 09:22:13.031263766 -0400 -@@ -35,6 +35,7 @@ pacrunner* pacrunner_extension::get(stri - if (this->last == pac) - return this->pr; - delete this->pr; -+ this->pr = NULL; - } - - return this->pr = this->create(pac, pacurl); -diff -up libproxy-0.4.11/libproxy/modules/pacrunner_mozjs.cpp.mozjscrash libproxy-0.4.11/libproxy/modules/pacrunner_mozjs.cpp diff --git a/libproxy.spec b/libproxy.spec index ae8875a..d56565a 100644 --- a/libproxy.spec +++ b/libproxy.spec @@ -4,7 +4,7 @@ Name: libproxy Version: 0.4.15 -Release: 5%{?dist} +Release: 6%{?dist} Summary: A library handling all the details of proxy configuration Group: System Environment/Libraries @@ -15,7 +15,7 @@ Source0: https://github.com/libproxy/%{name}/archive/%{version}.tar.gz Source1: proxy.1 # http://code.google.com/p/libproxy/issues/detail?id=152 Patch0: 0001-Add-config-module-for-querying-PacRunner-d-mon.patch -Patch1: libproxy-pacrunner-crash-fix.patch +Patch1: libproxy-0.4.11-crash.patch BuildRequires: libmodman-devel >= 2.0.1 BuildRequires: cmake >= 2.6.0 @@ -241,6 +241,9 @@ make test %changelog +* Fri May 04 2018 David King - 0.4.15-6 +- Resurrect an old patch (#1459779) + * Wed Feb 07 2018 Fedora Release Engineering - 0.4.15-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild