Skip to content

Commit b6cd381

Browse files
aescolarnashif
authored andcommitted
tests/net/conn_mgr_nsos: Initialize address to 0 to avoid valgrind warning
Initialize the whole address to 0, to avoid a valgrind warning when a copy of the address is passed to the Linux kernel: ``` Syscall param socketcall.sendto(to.sin_addr) points to uninitialised bytes at _dl_sysinfo_int80 (in /usr/lib/i386-linux-gnu/ld-linux.so.2) by sendto (sendto.c:30) by nsos_adapt_sendto (nsos_adapt.c:544) ``` Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
1 parent 06a4cff commit b6cd381

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • tests/net/conn_mgr_nsos/src

tests/net/conn_mgr_nsos/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ ZTEST(conn_mgr_nsos, test_conn_mgr_nsos)
130130
ZTEST(conn_mgr_nsos, test_conn_mgr_nsos_idle)
131131
{
132132
struct net_if *iface = net_if_get_default();
133-
struct net_sockaddr_in v4addr;
133+
struct net_sockaddr_in v4addr = {0};
134134
int sock, rc;
135135

136136
/* 2 second idle timeout */

0 commit comments

Comments
 (0)