From 188d5563b5c28cd93a51bcdc610bdcf309e0eb6604b856f9847eae5a86bde1ed Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 3 Mar 2022 10:16:37 +0000 Subject: [PATCH] Accepting request 958719 from home:marxin:branches:Base:System - Add gcc12-fix.patch upstream fix for GCC 12 compiler. OBS-URL: https://build.opensuse.org/request/show/958719 OBS-URL: https://build.opensuse.org/package/show/Base:System/nfs-utils?expand=0&rev=250 --- gcc12-fix.patch | 36 ++++++++++++++++++++++++++++++++++++ nfs-utils.changes | 5 +++++ nfs-utils.spec | 1 + 3 files changed, 42 insertions(+) create mode 100644 gcc12-fix.patch diff --git a/gcc12-fix.patch b/gcc12-fix.patch new file mode 100644 index 0000000..f1698eb --- /dev/null +++ b/gcc12-fix.patch @@ -0,0 +1,36 @@ +From 7f8463fe702174bd613df9d308cc899af25ae02e Mon Sep 17 00:00:00 2001 +From: Steve Dickson +Date: Wed, 23 Feb 2022 15:19:51 -0500 +Subject: [PATCH] systemd: Fix format-overflow warning + +rpc-pipefs-generator.c:35:23: error: '%s' directive output between 0 and 2147483653 bytes may exceed minimum required size of 4095 [-Werror=format-overflow=] + 35 | sprintf(path, "%s/%s", dirname, pipefs_unit); + | ^ + +Signed-off-by: Steve Dickson +--- + systemd/rpc-pipefs-generator.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/systemd/rpc-pipefs-generator.c b/systemd/rpc-pipefs-generator.c +index c24db56..7b2bb4f 100644 +--- a/systemd/rpc-pipefs-generator.c ++++ b/systemd/rpc-pipefs-generator.c +@@ -28,11 +28,12 @@ static int generate_mount_unit(const char *pipefs_path, const char *pipefs_unit, + { + char *path; + FILE *f; ++ size_t size = (strlen(dirname) + 1 + strlen(pipefs_unit)); + +- path = malloc(strlen(dirname) + 1 + strlen(pipefs_unit)); ++ path = malloc(size); + if (!path) + return 1; +- sprintf(path, "%s/%s", dirname, pipefs_unit); ++ snprintf(path, size, "%s/%s", dirname, pipefs_unit); + f = fopen(path, "w"); + if (!f) + { +-- +1.8.3.1 + diff --git a/nfs-utils.changes b/nfs-utils.changes index 91bb732..0099ae6 100644 --- a/nfs-utils.changes +++ b/nfs-utils.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Mar 3 10:08:47 UTC 2022 - Martin Liška + +- Add gcc12-fix.patch upstream fix for GCC 12 compiler. + ------------------------------------------------------------------- Mon Jan 31 07:24:41 UTC 2022 - Petr Vorel diff --git a/nfs-utils.spec b/nfs-utils.spec index d4436b7..c58dfbc 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -42,6 +42,7 @@ Source25: rpc-svcgssd.options.conf Source26: nfs.conf Source27: nfs-kernel-server.tmpfiles.conf Patch0: nfs-utils-1.0.7-bind-syntax.patch +Patch1: gcc12-fix.patch BuildRequires: e2fsprogs-devel BuildRequires: gcc-c++