fix two bugs

- Fix file descriptor leak (#911066)
- Fix crash when pacrunner fails (probably because of EMFILE...) (#998232)
This commit is contained in:
Dan Winship 2013-09-19 09:33:19 -04:00
parent 564e5e5f3c
commit 56b5a66393
3 changed files with 41 additions and 1 deletions

View File

@ -0,0 +1,12 @@
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

View File

@ -0,0 +1,20 @@
diff -up libproxy-0.4.11/libproxy/url.cpp.fdleak libproxy-0.4.11/libproxy/url.cpp
--- libproxy-0.4.11/libproxy/url.cpp.fdleak 2013-09-19 08:45:48.718145364 -0400
+++ libproxy-0.4.11/libproxy/url.cpp 2013-09-19 08:46:31.374147676 -0400
@@ -403,6 +403,7 @@ char* url::get_pac() {
buffer = NULL;
}
}
+ close (sock);
return buffer;
}
@@ -495,7 +496,7 @@ char* url::get_pac() {
}
// Clean up
- shutdown(sock, SHUT_RDWR);
+ close(sock);
return buffer;
}

View File

@ -13,7 +13,7 @@
Name: libproxy
Version: 0.4.11
Release: 6%{?svn}%{?dist}
Release: 7%{?svn}%{?dist}
Summary: A library handling all the details of proxy configuration
Group: System Environment/Libraries
@ -25,6 +25,8 @@ Patch0: libproxy-0.4.10-mozjs.patch
Patch1: 0001-pacrunner_mozjs-Also-support-mozjs-17.0.patch
# http://code.google.com/p/libproxy/issues/detail?id=152
Patch2: 0001-Add-config-module-for-querying-PacRunner-d-mon.patch
Patch3: libproxy-0.4.11-fdleak.patch
Patch4: libproxy-0.4.11-crash.patch
BuildRequires: python-devel
BuildRequires: libmodman-devel >= 2.0.1
@ -191,6 +193,8 @@ developing applications that use %{name}.
%patch0 -p1 -b .orig
%patch1 -p1 -b .orig
%patch2 -p1 -b .orig
%patch3 -p1 -b .fdleak
%patch4 -p1 -b .crash
%build
%{cmake} \
@ -293,6 +297,10 @@ make test
%changelog
* Thu Sep 19 2013 Dan Winship <danw@redhat.com> - 0.4.11-7
- Fix file descriptor leak (#911066)
- Fix crash when pacrunner fails (probably because of EMFILE...) (#998232)
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.11-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild