storage_mon: use memset() to fix "uninitialized value" covscan error, as qb_ipcc_recv() will always set a message (according to honzaf)

This commit is contained in:
bixiaoyan 2024-02-23 11:29:46 +08:00
parent 908d1c717c
commit da84d255a1
2 changed files with 32 additions and 2 deletions

View File

@ -0,0 +1,26 @@
From cb968378959b8aa334e98daf62a1b08ef6525fb4 Mon Sep 17 00:00:00 2001
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
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

View File

@ -1,7 +1,7 @@
Name: resource-agents Name: resource-agents
Summary: Open Source HA Reusable Cluster Resource Scripts Summary: Open Source HA Reusable Cluster Resource Scripts
Version: 4.13.0 Version: 4.13.0
Release: 4 Release: 5
License: GPLv2+ and LGPLv2+ License: GPLv2+ and LGPLv2+
URL: https://github.com/ClusterLabs/resource-agents URL: https://github.com/ClusterLabs/resource-agents
Source0: https://github.com/ClusterLabs/resource-agents/archive/v%{version}.tar.gz 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 Patch0001: Fix-PRIMARY_IFACE-variable.patch
Patch0002: fix-loopback-handling.patch Patch0002: fix-loopback-handling.patch
Patch0003: fix-handler-out-of-scope-leak.patch Patch0003: fix-handler-out-of-scope-leak.patch
Patch0004: fix-uninitialized-value-covscan-error.patch
Obsoletes: heartbeat-resources <= %{version} Obsoletes: heartbeat-resources <= %{version}
Provides: heartbeat-resources = %{version} Provides: heartbeat-resources = %{version}
BuildRequires: automake autoconf pkgconfig gcc perl-interpreter perl-generators python3-devel 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*} %{_mandir}/man8/{ocf-tester.8*,ldirectord.8*}
%changelog %changelog
* Fri Feb 23 2024 bixiaoyan <bixiaoyoan@kylinos.cn> - 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 <bixiaoyan@kylinos.cn> - 4.13.0-4 * Thu Feb 22 2024 bixiaoyan <bixiaoyan@kylinos.cn> - 4.13.0-4
- fix handler out of scope leak, unitialized value and check that netmaskbits != EOS - fix handler out of scope leak, unitialized value and check that netmaskbits != EOS
* Tue Nov 7 2023 bixiaoyan <bixiaoyan@kylinos.cn> - 4.13.0-3 * Tue Nov 7 2023 bixiaoyan <bixiaoyan@kylinos.cn> - 4.13.0-3
- Fix loopback handling - Fix loopback handling