File 1142-erts-Silence-CodeChecker-for-get-peer-sock-name.patch of Package erlang
From 301b356c389ca193f7377c363c41e5a7178ba00b Mon Sep 17 00:00:00 2001
From: Sverker Eriksson <sverker@erlang.org>
Date: Fri, 19 Feb 2021 20:38:29 +0100
Subject: [PATCH 02/10] erts: Silence CodeChecker for get{peer,sock}name
---
erts/epmd/src/epmd_srv.c | 4 ++++
lib/tools/c_src/erl_memory.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/erts/epmd/src/epmd_srv.c b/erts/epmd/src/epmd_srv.c
index f8fbc45cd2..28366964ac 100644
--- a/erts/epmd/src/epmd_srv.c
+++ b/erts/epmd/src/epmd_srv.c
@@ -1162,6 +1162,10 @@ static int conn_local_peer_check(EpmdVars *g, int fd)
#endif
st = sizeof(si);
+#ifdef __clang_analyzer__
+ /* CodeChecker does not seem to understand getpeername writes to 'si' */
+ memset(&si, 0, sizeof(si));
+#endif
/* Determine if connection is from localhost */
if (getpeername(fd,(struct sockaddr*) &si,&st) ||
diff --git a/lib/tools/c_src/erl_memory.c b/lib/tools/c_src/erl_memory.c
index f247e6568d..9e2bf98877 100644
--- a/lib/tools/c_src/erl_memory.c
+++ b/lib/tools/c_src/erl_memory.c
@@ -939,6 +939,10 @@ print_emu_arg(em_state *state)
size_t size;
char *format = "> Emulator command line argument: +Mit %s\n";
+#ifdef __clang_analyzer__
+ /* CodeChecker does not seem to understand getsockname writes to saddr */
+ memset(&saddr, 0, sizeof(saddr));
+#endif
if (getsockname(state->input.socket,
(struct sockaddr *) &saddr,
&saddr_size) != 0)
--
2.26.2