diff --git a/0002-Don-t-attempt-to-memcpy-zero-bytes.patch b/0002-Don-t-attempt-to-memcpy-zero-bytes.patch new file mode 100644 index 0000000..fa45a14 --- /dev/null +++ b/0002-Don-t-attempt-to-memcpy-zero-bytes.patch @@ -0,0 +1,34 @@ +From 78a5e2e17bba531b41101ca036a5bb1a0d5caca5 Mon Sep 17 00:00:00 2001 +From: Stephen Gallagher +Date: Tue, 6 Feb 2024 21:15:33 -0500 +Subject: [PATCH 2/2] Don't attempt to memcpy() zero bytes + +add_rtattr_nest() is called in several places in the code. As part of +its operation, it calls add_rtattr(nm type, NULL, 0) which results in +NULL and 0 being passed to memcpy(). This fails with -Werror=nonnull +on recent GCC. + +Signed-off-by: Stephen Gallagher +--- + lib/rtnetlink.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/lib/rtnetlink.c b/lib/rtnetlink.c +index 3b8413718997568a20752791807b19c1f299955e..faa60d7c12f68af175d223b6c3c3257a982e4f37 100644 +--- a/lib/rtnetlink.c ++++ b/lib/rtnetlink.c +@@ -172,7 +172,10 @@ static void add_rtattr(struct nlmsghdr *n, int type, const void *data, int alen) + + rta->rta_type = type; + rta->rta_len = len; +- memcpy(RTA_DATA(rta), data, alen); ++ if (alen > 0) ++ { ++ memcpy(RTA_DATA(rta), data, alen); ++ } + n->nlmsg_len = NLMSG_ALIGN(n->nlmsg_len) + RTA_ALIGN(len); + } + +-- +2.43.0 + diff --git a/fcoe-utils.spec b/fcoe-utils.spec index e0ad9a4..263df66 100644 --- a/fcoe-utils.spec +++ b/fcoe-utils.spec @@ -7,7 +7,7 @@ Name: fcoe-utils Version: 1.0.34 -Release: 8.git%{shortcommit0}%{?dist} +Release: 9.git%{shortcommit0}%{?dist} Summary: Fibre Channel over Ethernet utilities License: GPL-2.0-only URL: http://www.open-fcoe.org @@ -29,6 +29,9 @@ Requires(postun): systemd Patch1: 0001-fcoemon-add-snprintf-string-precision-modifiers-in-f.patch +# https://github.com/openSUSE/fcoe-utils/pull/25 +Patch2: 0002-Don-t-attempt-to-memcpy-zero-bytes.patch + # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: %{ix86} @@ -83,6 +86,9 @@ done %{_libexecdir}/fcoe/ %changelog +* Tue Feb 06 2024 Stephen Gallagher - 1.0.34-9.gitb233050 +- FTBFS: Don't attempt to memcpy() zero bytes + * Wed Jan 24 2024 Fedora Release Engineering - 1.0.34-8.gitb233050 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild