commit:     a951a89289d8b3d8129f02141e38f5413a55902f
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 28 13:41:50 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jul 28 13:41:50 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a951a892

net-analyzer/mtr: backport F_S=3 fix

Closes: https://bugs.gentoo.org/911389
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../mtr/files/mtr-0.95-fortify-source-3.patch      | 34 ++++++++++++++++++++++
 .../mtr/{mtr-9999.ebuild => mtr-0.95-r1.ebuild}    |  9 +++---
 net-analyzer/mtr/mtr-9999.ebuild                   |  9 +++---
 3 files changed, 44 insertions(+), 8 deletions(-)

diff --git a/net-analyzer/mtr/files/mtr-0.95-fortify-source-3.patch 
b/net-analyzer/mtr/files/mtr-0.95-fortify-source-3.patch
new file mode 100644
index 000000000000..0c3d593915e4
--- /dev/null
+++ b/net-analyzer/mtr/files/mtr-0.95-fortify-source-3.patch
@@ -0,0 +1,34 @@
+https://bugs.gentoo.org/911389
+https://github.com/traviscross/mtr/pull/468
+https://github.com/traviscross/mtr/commit/a1548b40c0dcf6dd44c5e6906f829e249428436b
+
+From 5908af4c19188cb17b62f23368b6ef462831a0cb Mon Sep 17 00:00:00 2001
+From: Marcus Meissner <[email protected]>
+Date: Tue, 11 Apr 2023 16:05:36 +0200
+Subject: [PATCH] fixed the sizes passed into snprintf
+
+--- a/ui/report.c
++++ b/ui/report.c
+@@ -140,7 +140,7 @@ void report_close(
+             continue;
+ 
+         snprintf(fmt, sizeof(fmt), "%%%ds", data_fields[j].length);
+-        snprintf(buf + len, sizeof(buf), fmt, data_fields[j].title);
++        snprintf(buf + len, sizeof(buf) - len, fmt, data_fields[j].title);
+         len += data_fields[j].length;
+     }
+     printf("%s\n", buf);
+@@ -172,10 +172,10 @@ void report_close(
+ 
+             /* 1000.0 is a temporary hack for stats usec to ms, impacted 
net_loss. */
+             if (strchr(data_fields[j].format, 'f')) {
+-                snprintf(buf + len, sizeof(buf), data_fields[j].format,
++                snprintf(buf + len, sizeof(buf) - len, data_fields[j].format,
+                          data_fields[j].net_xxx(at) / 1000.0);
+             } else {
+-                snprintf(buf + len, sizeof(buf), data_fields[j].format,
++                snprintf(buf + len, sizeof(buf) - len, data_fields[j].format,
+                          data_fields[j].net_xxx(at));
+             }
+             len += data_fields[j].length;
+

diff --git a/net-analyzer/mtr/mtr-9999.ebuild 
b/net-analyzer/mtr/mtr-0.95-r1.ebuild
similarity index 84%
copy from net-analyzer/mtr/mtr-9999.ebuild
copy to net-analyzer/mtr/mtr-0.95-r1.ebuild
index 42b6aeb30b04..a2c2010db273 100644
--- a/net-analyzer/mtr/mtr-9999.ebuild
+++ b/net-analyzer/mtr/mtr-0.95-r1.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
 inherit autotools bash-completion-r1 fcaps
 
@@ -13,7 +13,7 @@ if [[ ${PV} == *9999* ]] ; then
        inherit git-r3
 else
        SRC_URI="https://github.com/traviscross/${PN}/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
-       KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 
~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
+       KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv 
~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
 fi
 
 LICENSE="GPL-2"
@@ -28,7 +28,7 @@ RDEPEND="
                x11-libs/gtk+:3
        )
        jansson? ( dev-libs/jansson:= )
-       ncurses? ( sys-libs/ncurses:0= )
+       ncurses? ( sys-libs/ncurses:= )
 "
 DEPEND="${RDEPEND}"
 BDEPEND="virtual/pkgconfig"
@@ -38,6 +38,7 @@ FILECAPS=( cap_net_raw usr/sbin/mtr-packet )
 
 PATCHES=(
        "${FILESDIR}"/${PN}-0.88-tinfo.patch
+       "${FILESDIR}"/${P}-fortify-source-3.patch
 )
 
 src_prepare() {

diff --git a/net-analyzer/mtr/mtr-9999.ebuild b/net-analyzer/mtr/mtr-9999.ebuild
index 42b6aeb30b04..a2c2010db273 100644
--- a/net-analyzer/mtr/mtr-9999.ebuild
+++ b/net-analyzer/mtr/mtr-9999.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
 inherit autotools bash-completion-r1 fcaps
 
@@ -13,7 +13,7 @@ if [[ ${PV} == *9999* ]] ; then
        inherit git-r3
 else
        SRC_URI="https://github.com/traviscross/${PN}/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
-       KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 
~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
+       KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv 
~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
 fi
 
 LICENSE="GPL-2"
@@ -28,7 +28,7 @@ RDEPEND="
                x11-libs/gtk+:3
        )
        jansson? ( dev-libs/jansson:= )
-       ncurses? ( sys-libs/ncurses:0= )
+       ncurses? ( sys-libs/ncurses:= )
 "
 DEPEND="${RDEPEND}"
 BDEPEND="virtual/pkgconfig"
@@ -38,6 +38,7 @@ FILECAPS=( cap_net_raw usr/sbin/mtr-packet )
 
 PATCHES=(
        "${FILESDIR}"/${PN}-0.88-tinfo.patch
+       "${FILESDIR}"/${P}-fortify-source-3.patch
 )
 
 src_prepare() {

Reply via email to