net-analyzer/dnstracer: Fix buffer overflow in host argument (bug #620928).
authorJeroen Roovers <jer@gentoo.org>
Wed, 7 Feb 2018 18:23:41 +0000 (19:23 +0100)
committerJeroen Roovers <jer@gentoo.org>
Wed, 7 Feb 2018 21:13:56 +0000 (22:13 +0100)
Package-Manager: Portage-2.3.24, Repoman-2.3.6

net-analyzer/dnstracer/dnstracer-1.9-r2.ebuild [new file with mode: 0644]
net-analyzer/dnstracer/files/dnstracer-1.9-argv0.patch [new file with mode: 0644]

diff --git a/net-analyzer/dnstracer/dnstracer-1.9-r2.ebuild b/net-analyzer/dnstracer/dnstracer-1.9-r2.ebuild
new file mode 100644 (file)
index 0000000..b5c4911
--- /dev/null
@@ -0,0 +1,22 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="Determines where a given nameserver gets its information from"
+HOMEPAGE="http://www.mavetju.org/unix/general.php"
+SRC_URI="http://www.mavetju.org/download/${P}.tar.gz"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux"
+IUSE="ipv6"
+
+DOCS=( CHANGES README )
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.9-argv0.patch
+)
+
+src_configure() {
+       econf $(use_enable ipv6)
+}
diff --git a/net-analyzer/dnstracer/files/dnstracer-1.9-argv0.patch b/net-analyzer/dnstracer/files/dnstracer-1.9-argv0.patch
new file mode 100644 (file)
index 0000000..c83c38e
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/dnstracer.c
++++ b/dnstracer.c
+@@ -1619,7 +1619,7 @@
+     if (argv[0] == NULL) usage();
+ 
+     // check for a trailing dot
+-    strcpy(argv0, argv[0]);
++    strncpy(argv0, argv[0], NS_MAXDNAME);
+     if (argv0[strlen(argv[0]) - 1] == '.') argv0[strlen(argv[0]) - 1] = 0;
+ 
+     printf("Tracing to %s[%s] via %s, maximum of %d retries\n",