From da84d255a131226a89f17111b441c9e41b212d0c Mon Sep 17 00:00:00 2001 From: bixiaoyan Date: Fri, 23 Feb 2024 11:29:46 +0800 Subject: [PATCH] storage_mon: use memset() to fix "uninitialized value" covscan error, as qb_ipcc_recv() will always set a message (according to honzaf) --- fix-uninitialized-value-covscan-error.patch | 26 +++++++++++++++++++++ resource-agents.spec | 8 +++++-- 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 fix-uninitialized-value-covscan-error.patch diff --git a/fix-uninitialized-value-covscan-error.patch b/fix-uninitialized-value-covscan-error.patch new file mode 100644 index 0000000..be6a157 --- /dev/null +++ b/fix-uninitialized-value-covscan-error.patch @@ -0,0 +1,26 @@ +From cb968378959b8aa334e98daf62a1b08ef6525fb4 Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Wed, 22 Nov 2023 10:32:31 +0100 +Subject: [PATCH] storage_mon: use memset() to fix "uninitialized value" + covscan error, as qb_ipcc_recv() will always set a message (according to + honzaf) + +--- + tools/storage_mon.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/tools/storage_mon.c b/tools/storage_mon.c +index cc415e97..a9227ef9 100644 +--- a/tools/storage_mon.c ++++ b/tools/storage_mon.c +@@ -655,6 +655,7 @@ storage_mon_client(void) + int32_t rc; + + ++ memset(&response, 0, sizeof(response)); + snprintf(ipcs_name, SMON_MAX_IPCSNAME, "storage_mon_%s", attrname); + conn = qb_ipcc_connect(ipcs_name, 0); + if (conn == NULL) { +-- +2.25.1 + diff --git a/resource-agents.spec b/resource-agents.spec index 15901fd..6ecd1a6 100644 --- a/resource-agents.spec +++ b/resource-agents.spec @@ -1,7 +1,7 @@ Name: resource-agents Summary: Open Source HA Reusable Cluster Resource Scripts Version: 4.13.0 -Release: 4 +Release: 5 License: GPLv2+ and LGPLv2+ URL: https://github.com/ClusterLabs/resource-agents Source0: https://github.com/ClusterLabs/resource-agents/archive/v%{version}.tar.gz @@ -9,6 +9,7 @@ Patch0000: fix-failed-to-parse-pid-from-pid-file.patch Patch0001: Fix-PRIMARY_IFACE-variable.patch Patch0002: fix-loopback-handling.patch Patch0003: fix-handler-out-of-scope-leak.patch +Patch0004: fix-uninitialized-value-covscan-error.patch Obsoletes: heartbeat-resources <= %{version} Provides: heartbeat-resources = %{version} BuildRequires: automake autoconf pkgconfig gcc perl-interpreter perl-generators python3-devel @@ -106,9 +107,12 @@ export CFLAGS="$(echo '%{optflags}')" %{_mandir}/man8/{ocf-tester.8*,ldirectord.8*} %changelog +* Fri Feb 23 2024 bixiaoyan - 4.13.0-5 +- use memset() to fix "uninitialized value" covscan error, as qb_ipcc_recv() will always set a message (according to honzaf) + * Thu Feb 22 2024 bixiaoyan - 4.13.0-4 - fix handler out of scope leak, unitialized value and check that netmaskbits != EOS - + * Tue Nov 7 2023 bixiaoyan - 4.13.0-3 - Fix loopback handling