From 172956c28182ecbce3b896789b5fc2a2ab220ea6 Mon Sep 17 00:00:00 2001 From: openeuler-ci-bot <80474298@qq.com> Date: Tue, 10 Nov 2020 23:30:19 +0800 Subject: [PATCH 1/7] [patch tracking] 20201110233007665697 - https://github.com/libproxy/libproxy/commit/ed7726bbda072bf89cb08fde01a5e30eb1be09cb --- ...26bbda072bf89cb08fde01a5e30eb1be09cb.patch | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 ed7726bbda072bf89cb08fde01a5e30eb1be09cb.patch diff --git a/ed7726bbda072bf89cb08fde01a5e30eb1be09cb.patch b/ed7726bbda072bf89cb08fde01a5e30eb1be09cb.patch new file mode 100644 index 0000000..7751d30 --- /dev/null +++ b/ed7726bbda072bf89cb08fde01a5e30eb1be09cb.patch @@ -0,0 +1,40 @@ +diff --git a/libproxy/proxy.cpp b/libproxy/proxy.cpp +index 2d01d53..72d0039 100644 +--- a/libproxy/proxy.cpp ++++ b/libproxy/proxy.cpp +@@ -244,7 +244,7 @@ void proxy_factory::check_network_topology() { + vector wpads = this->mm.get_extensions(); + for (vector::iterator j=wpads.begin() ; j != wpads.end() ; j++) + (*j)->rewind(); +- if (this->pac) delete this->pac; ++ if (this->pac) delete[] this->pac; + this->pac = NULL; + break; + } +@@ -313,7 +313,7 @@ bool proxy_factory::expand_wpad(const url &confurl) + rtv = true; + /* If the config has just changed from PAC to WPAD, clear the PAC */ + if (!this->wpad) { +- if (this->pac) delete this->pac; ++ if (this->pac) delete[] this->pac; + if (this->pacurl) delete this->pacurl; + this->pac = NULL; + this->pacurl = NULL; +@@ -381,7 +381,7 @@ bool proxy_factory::expand_pac(url &confurl) + if (this->pac) { + if (this->pacurl->to_string() != confurl.to_string()) { + delete this->pacurl; +- delete this->pac; ++ delete[] this->pac; + this->pacurl = NULL; + this->pac = NULL; + } +@@ -424,7 +424,7 @@ void proxy_factory::run_pac(url &realurl, const url &confurl, vector &re + + void proxy_factory::clear_cache() { + this->wpad = false; +- if (this->pac) { delete this->pac; this->pac = NULL; } ++ if (this->pac) { delete[] this->pac; this->pac = NULL; } + if (this->pacurl) { delete this->pacurl; this->pacurl = NULL; } + } + -- Gitee From 280beb6db591e0a24151c291f20e350bf879bf0a Mon Sep 17 00:00:00 2001 From: openeuler-ci-bot <80474298@qq.com> Date: Tue, 10 Nov 2020 23:30:20 +0800 Subject: [PATCH 2/7] [patch tracking] 20201110233007665697 - https://github.com/libproxy/libproxy/commit/3e33513e2cde494ecd14363c3dd3ecb7f9ac1627 --- ...513e2cde494ecd14363c3dd3ecb7f9ac1627.patch | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 3e33513e2cde494ecd14363c3dd3ecb7f9ac1627.patch diff --git a/3e33513e2cde494ecd14363c3dd3ecb7f9ac1627.patch b/3e33513e2cde494ecd14363c3dd3ecb7f9ac1627.patch new file mode 100644 index 0000000..cc83279 --- /dev/null +++ b/3e33513e2cde494ecd14363c3dd3ecb7f9ac1627.patch @@ -0,0 +1,32 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9f26a7c..4f51e38 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -33,24 +33,9 @@ include(cmake/paths.cmk) + option(WITH_WEBKIT3 "Build against gtk-3 version of webkitgtk" OFF) + + ### Subdirectories +-# Conditionally build bundled libmodman +-option(FORCE_SYSTEM_LIBMODMAN "Force using system libmodman" OFF) +-find_package(libmodman QUIET) +-if(LIBMODMAN_FOUND) +- if("${LIBMODMAN_VERSION_MAJOR}" STREQUAL "2") +- message(STATUS "Building with system libmodman") +- else() +- message(FATAL_ERROR "Found incompatible libmodman on your system (libmodman 2.X is needed)") +- endif() +-else() +- if(FORCE_SYSTEM_LIBMODMAN) +- message(FATAL_ERROR "Libmodman could not be found on your system") +- else() +- message(STATUS "Building with bundled libmodman") +- add_subdirectory(libmodman) +- include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +- endif() +-endif() ++ ++add_subdirectory(libmodman) ++include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + + # Conditionally build bindings + if(NOT WIN32) -- Gitee From bc0e514a252de9546c950345ff5b69c9679ed64f Mon Sep 17 00:00:00 2001 From: openeuler-ci-bot <80474298@qq.com> Date: Tue, 10 Nov 2020 23:30:20 +0800 Subject: [PATCH 3/7] [patch tracking] 20201110233007665697 - https://github.com/libproxy/libproxy/commit/d3b6d8767b2147d2f14c974d5bd7a0dbfae63c62 --- ...d8767b2147d2f14c974d5bd7a0dbfae63c62.patch | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 d3b6d8767b2147d2f14c974d5bd7a0dbfae63c62.patch diff --git a/d3b6d8767b2147d2f14c974d5bd7a0dbfae63c62.patch b/d3b6d8767b2147d2f14c974d5bd7a0dbfae63c62.patch new file mode 100644 index 0000000..5ad6156 --- /dev/null +++ b/d3b6d8767b2147d2f14c974d5bd7a0dbfae63c62.patch @@ -0,0 +1,38 @@ +diff --git a/.travis.yml b/.travis.yml +index 6d3e81d..67abba4 100644 +--- a/.travis.yml ++++ b/.travis.yml +@@ -39,6 +39,7 @@ script: + -DWITH_GNOME3=ON \ + -DWITH_KDE=ON \ + -DWITH_WEBKIT3=ON \ ++ -DWITH_MOZJS=ON \ + -DBIPR=0 + - make + - sudo make install +diff --git a/INSTALL b/INSTALL +index bf04881..ab292cf 100644 +--- a/INSTALL ++++ b/INSTALL +@@ -101,7 +101,7 @@ WITH_KDE: Default to ON. Enables plug-in to read proxy settings + Note: this plug-in only has a *runtime* dependency on + either kreadconfig or kreadconfig5. + +-WITH_MOZJS: Default to ON. Enable Mozilla javascript bindings. As ++WITH_MOZJS: Default to OFF. Enable Mozilla javascript bindings. As + Mozilla Javascript engine is often installed multiple + you can set prefered order using MOZJS_SEARCH_ORDER, + wich defaults to "xulrunner-js;firefox-js;mozilla-js;seamonkey-js". +diff --git a/libproxy/cmake/modules.cmk b/libproxy/cmake/modules.cmk +index 0794a6e..11d2d43 100644 +--- a/libproxy/cmake/modules.cmk ++++ b/libproxy/cmake/modules.cmk +@@ -44,7 +44,7 @@ if(NM_FOUND OR NMold_FOUND) + set(NM_BUILD 1) + endif(NM_FOUND OR NMold_FOUND) + px_module(network_networkmanager "${NM_BUILD}" 0 ${NM_LIBRARIES}${NMold_LIBRARIES}) +-px_module(pacrunner_mozjs "${MOZJS_FOUND}" ${BIPR} ${MOZJS_LIBRARIES}) ++px_module(pacrunner_mozjs 0 ${BIPR} ${MOZJS_LIBRARIES}) + px_module(pacrunner_natus "${NATUS_FOUND}" ${BIPR} ${NATUS_LIBRARIES}) + px_module(pacrunner_webkit "${WEBKIT_FOUND}" ${BIPR} ${WEBKIT_LIBRARIES}) + px_module(wpad_dns_alias 1 1) -- Gitee From bff18b18ab988fbd3cbe9204c9a3db456761286b Mon Sep 17 00:00:00 2001 From: openeuler-ci-bot <80474298@qq.com> Date: Tue, 10 Nov 2020 23:30:21 +0800 Subject: [PATCH 4/7] [patch tracking] 20201110233007665697 - https://github.com/libproxy/libproxy/commit/160d9bd2718293484d836892b1cdddafa5cb78ce --- ...9bd2718293484d836892b1cdddafa5cb78ce.patch | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 160d9bd2718293484d836892b1cdddafa5cb78ce.patch diff --git a/160d9bd2718293484d836892b1cdddafa5cb78ce.patch b/160d9bd2718293484d836892b1cdddafa5cb78ce.patch new file mode 100644 index 0000000..78bf812 --- /dev/null +++ b/160d9bd2718293484d836892b1cdddafa5cb78ce.patch @@ -0,0 +1,55 @@ +diff --git a/libproxy/extension_pacrunner.cpp b/libproxy/extension_pacrunner.cpp +index de2ea7b..698f25f 100644 +--- a/libproxy/extension_pacrunner.cpp ++++ b/libproxy/extension_pacrunner.cpp +@@ -23,19 +23,11 @@ using namespace libproxy; + pacrunner::pacrunner(const string &, const url&) {} + + pacrunner_extension::pacrunner_extension() { +- this->pr = NULL; + } + + pacrunner_extension::~pacrunner_extension() { +- if (this->pr) delete this->pr; + } + + pacrunner* pacrunner_extension::get(const string &pac, const url& pacurl) { +- 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 --git a/libproxy/extension_pacrunner.hpp b/libproxy/extension_pacrunner.hpp +index eeb30f9..4834eb9 100644 +--- a/libproxy/extension_pacrunner.hpp ++++ b/libproxy/extension_pacrunner.hpp +@@ -56,10 +56,6 @@ class DLL_PUBLIC pacrunner_extension : public extension &re + + /* 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); + } -- Gitee From 2da80bcc66a05779d48a866e4ee8f877da6d9f77 Mon Sep 17 00:00:00 2001 From: openeuler-ci-bot <80474298@qq.com> Date: Tue, 10 Nov 2020 23:30:21 +0800 Subject: [PATCH 5/7] [patch tracking] 20201110233007665697 - https://github.com/libproxy/libproxy/commit/00b982d0378e941368ba95dbcd80f35ed9fb7052 --- ...82d0378e941368ba95dbcd80f35ed9fb7052.patch | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 00b982d0378e941368ba95dbcd80f35ed9fb7052.patch diff --git a/00b982d0378e941368ba95dbcd80f35ed9fb7052.patch b/00b982d0378e941368ba95dbcd80f35ed9fb7052.patch new file mode 100644 index 0000000..a794d87 --- /dev/null +++ b/00b982d0378e941368ba95dbcd80f35ed9fb7052.patch @@ -0,0 +1,49 @@ +diff --git a/bindings/python/libproxy.py b/bindings/python/libproxy.py +index c9b87c7..a29b33a 100644 +--- a/bindings/python/libproxy.py ++++ b/bindings/python/libproxy.py +@@ -1,3 +1,4 @@ ++# encoding: utf-8 + ############################################################################### + # libproxy - A library for proxy configuration + # Copyright (C) 2006 Nathaniel McCallum +@@ -108,9 +109,22 @@ def getProxies(self, url): + """ + if type(url) != str: + raise TypeError("url must be a string!") +- ++ ++ if type(url) is bytes: ++ # Python 2: str is bytes ++ url_bytes = url ++ else: ++ # Python 3: str is unicode ++ # TODO: Does this need to be encoded from IRI to ASCII (ACE) URI, ++ # for example http://кц.рф/пример -> ++ # http://xn--j1ay.xn--p1ai/%D0%BF%D1%80%D0%B8%D0%BC%D0%B5%D1%80? ++ # Or is libproxy designed to accept IRIs like ++ # http://кц.рф/пример? Passing in an IRI does seem to work ++ # acceptably in practice, so do that for now. ++ url_bytes = url.encode('utf-8') ++ + proxies = [] +- array = _libproxy.px_proxy_factory_get_proxies(self._pf, url) ++ array = _libproxy.px_proxy_factory_get_proxies(self._pf, url_bytes) + + if not bool(array): + raise ProxyFactory.ProxyResolutionError( +@@ -118,7 +132,13 @@ def getProxies(self, url): + + i=0 + while array[i]: +- proxies.append(str(ctypes.cast(array[i], ctypes.c_char_p).value)) ++ proxy_bytes = ctypes.cast(array[i], ctypes.c_char_p).value ++ if type(proxy_bytes) is str: ++ # Python 2 ++ proxies.append(proxy_bytes) ++ else: ++ # Python 3 ++ proxies.append(proxy_bytes.decode('utf-8', errors='replace')) + i += 1 + + _libproxy.px_proxy_factory_free_proxies(proxies) -- Gitee From 3c082f7a80b69c920e58ffb6138e15d583e850be Mon Sep 17 00:00:00 2001 From: openeuler-ci-bot <80474298@qq.com> Date: Tue, 10 Nov 2020 23:30:21 +0800 Subject: [PATCH 6/7] [patch tracking] 20201110233007665697 - https://github.com/libproxy/libproxy/commit/6d342b50366a048d3d543952e2be271b5742c5f8 --- ...2b50366a048d3d543952e2be271b5742c5f8.patch | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 6d342b50366a048d3d543952e2be271b5742c5f8.patch diff --git a/6d342b50366a048d3d543952e2be271b5742c5f8.patch b/6d342b50366a048d3d543952e2be271b5742c5f8.patch new file mode 100644 index 0000000..aeacdd9 --- /dev/null +++ b/6d342b50366a048d3d543952e2be271b5742c5f8.patch @@ -0,0 +1,81 @@ +diff --git a/libproxy/url.cpp b/libproxy/url.cpp +index cbbe6bb..7839afa 100644 +--- a/libproxy/url.cpp ++++ b/libproxy/url.cpp +@@ -51,7 +51,7 @@ using namespace std; + #define PAC_MIME_TYPE_FB "text/plain" + + // This is the maximum pac size (to avoid memory attacks) +-#define PAC_MAX_SIZE 102400 ++#define PAC_MAX_SIZE 0x800000 + // This is the default block size to use when receiving via HTTP + #define PAC_HTTP_BLOCK_SIZE 512 + +@@ -483,15 +483,13 @@ char* url::get_pac() { + } + + // Get content +- unsigned int recvd = 0; +- buffer = new char[PAC_MAX_SIZE]; +- memset(buffer, 0, PAC_MAX_SIZE); ++ std::vector dynamic_buffer; + do { + unsigned int chunk_length; + + if (chunked) { + // Discard the empty line if we received a previous chunk +- if (recvd > 0) recvline(sock); ++ if (!dynamic_buffer.empty()) recvline(sock); + + // Get the chunk-length line as an integer + if (sscanf(recvline(sock).c_str(), "%x", &chunk_length) != 1 || chunk_length == 0) break; +@@ -503,21 +501,41 @@ char* url::get_pac() { + + if (content_length >= PAC_MAX_SIZE) break; + +- while (content_length == 0 || recvd != content_length) { +- int r = recv(sock, buffer + recvd, +- content_length == 0 ? PAC_HTTP_BLOCK_SIZE +- : content_length - recvd, 0); ++ while (content_length == 0 || dynamic_buffer.size() != content_length) { ++ // Calculate length to recv ++ unsigned int length_to_read = PAC_HTTP_BLOCK_SIZE; ++ if (content_length > 0) ++ length_to_read = content_length - dynamic_buffer.size(); ++ ++ // Prepare buffer ++ dynamic_buffer.resize(dynamic_buffer.size() + length_to_read); ++ ++ int r = recv(sock, dynamic_buffer.data() + dynamic_buffer.size() - length_to_read, length_to_read, 0); ++ ++ // Shrink buffer to fit ++ if (r >= 0) ++ dynamic_buffer.resize(dynamic_buffer.size() - length_to_read + r); ++ ++ // PAC size too large, discard ++ if (dynamic_buffer.size() >= PAC_MAX_SIZE) { ++ chunked = false; ++ dynamic_buffer.clear(); ++ break; ++ } ++ + if (r <= 0) { + chunked = false; + break; + } +- recvd += r; + } + } while (chunked); + +- if (content_length != 0 && string(buffer).size() != content_length) { +- delete[] buffer; +- buffer = NULL; ++ if (content_length == 0 || content_length == dynamic_buffer.size()) { ++ buffer = new char[dynamic_buffer.size() + 1]; ++ if (!dynamic_buffer.empty()) { ++ memcpy(buffer, dynamic_buffer.data(), dynamic_buffer.size()); ++ } ++ buffer[dynamic_buffer.size()] = '\0'; + } + } + -- Gitee From 415d886014342be13c5a2c9fd4d76f7638e8ab95 Mon Sep 17 00:00:00 2001 From: openeuler-ci-bot <80474298@qq.com> Date: Tue, 10 Nov 2020 23:30:22 +0800 Subject: [PATCH 7/7] [patch tracking] 20201110233007665697 - update spec file --- libproxy.spec | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/libproxy.spec b/libproxy.spec index 7d257ec..853c326 100644 --- a/libproxy.spec +++ b/libproxy.spec @@ -1,6 +1,6 @@ Name: libproxy Version: 0.4.15 -Release: 18 +Release: 19 Summary: Libproxy is a library that provides automatic proxy configuration management License: LGPLv2+ @@ -19,6 +19,12 @@ Patch5: libproxy-0.4.15-mozjs60.patch Patch6: libproxy-0.4.15-mozjs68.patch Patch7: libproxy-0.4.15-mozjs-use-after-free.patch Patch8: libproxy-0.4.15-fix-CVE-2020-25219.patch +Patch6000: ed7726bbda072bf89cb08fde01a5e30eb1be09cb.patch +Patch6001: 3e33513e2cde494ecd14363c3dd3ecb7f9ac1627.patch +Patch6002: d3b6d8767b2147d2f14c974d5bd7a0dbfae63c62.patch +Patch6003: 160d9bd2718293484d836892b1cdddafa5cb78ce.patch +Patch6004: 00b982d0378e941368ba95dbcd80f35ed9fb7052.patch +Patch6005: 6d342b50366a048d3d543952e2be271b5742c5f8.patch BuildRequires: cmake >= 2.6.0 gcc-c++ @@ -115,6 +121,9 @@ make test %{_mandir}/man1/proxy.1* %changelog +* 20201110233007665697 patch-tracking 0.4.15-19 +- append patch file of upstream repository from to <6d342b50366a048d3d543952e2be271b5742c5f8> + * Thu Oct 30 2020 xihaochen - 0.4.15-18 - Type:requirements - Id:NA @@ -162,4 +171,4 @@ make test - DESC:remove the /usr/bin/kreadconfig5 in buildRequires. * Tue Sep 10 2019 liyongqiang - 0.4.15-10 -- Package init +- Package init \ No newline at end of file -- Gitee