net-libs/openslp: EAPI bump, add Fedora patch for CVE 2016-4912
authorAndreas K. Hüttel <dilfridge@gentoo.org>
Sat, 18 Feb 2017 13:01:53 +0000 (14:01 +0100)
committerAndreas K. Hüttel <dilfridge@gentoo.org>
Sat, 18 Feb 2017 13:01:53 +0000 (14:01 +0100)
Package-Manager: Portage-2.3.3, Repoman-2.3.1

net-libs/openslp/files/openslp-2.0.0-CVE-2016-4912.patch [new file with mode: 0644]
net-libs/openslp/openslp-2.0.0-r2.ebuild [new file with mode: 0644]

diff --git a/net-libs/openslp/files/openslp-2.0.0-CVE-2016-4912.patch b/net-libs/openslp/files/openslp-2.0.0-CVE-2016-4912.patch
new file mode 100644 (file)
index 0000000..d8a0eca
--- /dev/null
@@ -0,0 +1,15 @@
+Source: https://src.fedoraproject.org/cgit/rpms/openslp.git/plain/openslp-2.0.0-null-pointer-deref.patch
+See also https://bugs.gentoo.org/show_bug.cgi?id=583396
+
+diff -up openslp-2.0.0/common/slp_xmalloc.c.orig openslp-2.0.0/common/slp_xmalloc.c
+--- openslp-2.0.0/common/slp_xmalloc.c.orig    2012-12-07 01:52:08.000000000 +0100
++++ openslp-2.0.0/common/slp_xmalloc.c 2016-05-23 12:58:57.953532979 +0200
+@@ -203,6 +203,8 @@ void * _xrealloc(const char * file, int
+       if (x->size != size)
+       {
+          newptr = _xmalloc(file, line, size);
++         if (newptr == 0)
++            return 0;
+          memcpy(newptr, ptr, x->size);
+          _xfree(file, line, x);
+       }
diff --git a/net-libs/openslp/openslp-2.0.0-r2.ebuild b/net-libs/openslp/openslp-2.0.0-r2.ebuild
new file mode 100644 (file)
index 0000000..43d36bd
--- /dev/null
@@ -0,0 +1,42 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit autotools systemd
+
+DESCRIPTION="An open-source implementation of Service Location Protocol"
+HOMEPAGE="http://www.openslp.org/"
+SRC_URI="mirror://sourceforge/openslp/${P}.tar.gz"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="libressl"
+RESTRICT="test"
+
+DEPEND="
+       !libressl? ( dev-libs/openssl:0= )
+       libressl? ( dev-libs/libressl:0= )
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-2.0.0-cflags.patch
+       "${FILESDIR}"/${PN}-2.0.0-CVE-2016-4912.patch
+)
+
+src_prepare() {
+       default
+       eautoreconf
+}
+
+src_install() {
+       make DESTDIR="${D}" install || die "make install failed"
+       dodoc AUTHORS FAQ ChangeLog NEWS README* THANKS
+       rm -rfv "${D}"/usr/doc
+       dohtml -r .
+       newinitd "${FILESDIR}"/slpd-init slpd
+       systemd_dounit "${FILESDIR}"/slpd.service
+}