diff --git a/SOURCES/libtool-2.4.2-ENOMEM-1.patch b/SOURCES/libtool-2.4.2-ENOMEM-1.patch new file mode 100644 index 0000000..48e417d --- /dev/null +++ b/SOURCES/libtool-2.4.2-ENOMEM-1.patch @@ -0,0 +1,29 @@ +From b5d44b8447039671ad927ec4b5018ba2816331eb Mon Sep 17 00:00:00 2001 +From: Pavel Raiskup +Date: Fri, 12 Feb 2016 16:03:14 +0100 +Subject: [PATCH] libltdl: handle ENOMEM sooner + +Fixes bug#19890. Reported by Tobias Stoeckmann. + +* libltdl/loaders/dld_link.c (vm_open): Do not even try dld_link() +in case of ENOMEM. +--- + libltdl/loaders/dld_link.c | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/libltdl/loaders/dld_link.c b/libltdl/loaders/dld_link.c +index a73880f..0edf0df 100644 +--- a/libltdl/loaders/dld_link.c ++++ b/libltdl/loaders/dld_link.c +@@ -112,7 +112,7 @@ vm_open (lt_user_data loader_data LT__UNUSED, const char *filename, + { + lt_module module = lt__strdup (filename); + +- if (dld_link (filename) != 0) ++ if (module && dld_link (filename) != 0) + { + LT__SETERROR (CANNOT_OPEN); + FREE (module); +-- +2.9.3 + diff --git a/SOURCES/libtool-2.4.2-ENOMEM-2.patch b/SOURCES/libtool-2.4.2-ENOMEM-2.patch new file mode 100644 index 0000000..02f706b --- /dev/null +++ b/SOURCES/libtool-2.4.2-ENOMEM-2.patch @@ -0,0 +1,31 @@ +From 3f91af8052486127ce787a91d47fadc033948877 Mon Sep 17 00:00:00 2001 +From: Pavel Raiskup +Date: Mon, 16 Jan 2017 14:58:59 +0100 +Subject: [PATCH] libltdl: handle ENOMEM in lt_dlloader_remove() + +Reported by Alexander Hass. + +* libltdl/lt_dlloader.c (lt_dlloader_remove): Detect NULL return +value from lt_dlinterface_register. +--- + libltdl/lt_dlloader.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/libltdl/lt_dlloader.c b/libltdl/lt_dlloader.c +index 2c99a22..ed45195 100644 +--- a/libltdl/lt_dlloader.c ++++ b/libltdl/lt_dlloader.c +@@ -167,6 +167,10 @@ lt_dlloader_remove (const char *name) + + /* Fail if there are any open modules which use this loader. */ + iface = lt_dlinterface_register (id_string, NULL); ++ if (!iface) ++ /* No memory, error is already set. */ ++ return 0; ++ + while ((handle = lt_dlhandle_iterate (iface, handle))) + { + lt_dlhandle cur = handle; +-- +2.9.3 + diff --git a/SPECS/libtool.spec b/SPECS/libtool.spec index 646f890..3d216f9 100644 --- a/SPECS/libtool.spec +++ b/SPECS/libtool.spec @@ -3,7 +3,7 @@ Summary: The GNU Portable Library Tool Name: libtool Version: 2.4.2 -Release: 21%{?dist} +Release: 22%{?dist} License: GPLv2+ and LGPLv2+ and GFDL URL: http://www.gnu.org/software/libtool/ Group: Development/Tools @@ -17,6 +17,14 @@ Patch1: libtool-2.4.2-TEMPORARY-disable-gcj-tests.patch # fixed in next release. Patch2: libtool-2.4.2-tar-no-owner.patch +# Handle ENOMEM properly +# ~> #1404635 +# ~> upstream: b5d44b8447039 +Patch3: libtool-2.4.2-ENOMEM-1.patch +# ~> upstream: f003a1f96e67f +Patch4: libtool-2.4.2-ENOMEM-2.patch + + Requires(post): /sbin/install-info Requires(preun): /sbin/install-info @@ -80,6 +88,8 @@ Static libraries and header files for development with ltdl. %patch0 -p1 -b .rpath %patch1 -p1 -b .temp-disable-gcj-test %patch2 -p1 -b .tar-no-same-owner +%patch3 -p1 -b .ENOMEM-1 +%patch4 -p1 -b .ENOMEM-2 %build @@ -159,6 +169,9 @@ fi %{_libdir}/libltdl.so %changelog +* Fri Jan 20 2017 Pavel Raiskup - 2.4.2-22 +- fix ENOMEM issues in libltdl (rhbz#1404635) + * Wed Dec 09 2015 Pavel Raiskup - 2.4.2-21 - rebuild for new gcc (rhbz#1287191)