@@ -188,7 +188,7 @@
multi_get_create_instance_udp(struct multi_context *m, bool *floated)
{
struct gc_arena gc = gc_new();
- struct mroute_addr real;
+ struct mroute_addr real = {0};
struct multi_instance *mi = NULL;
struct hash *hash = m->hash;
@@ -1234,7 +1234,7 @@
bool primary)
{
struct openvpn_sockaddr remote_si;
- struct mroute_addr addr;
+ struct mroute_addr addr = {0};
CLEAR(remote_si);
remote_si.addr.in4.sin_family = AF_INET;
@@ -1273,7 +1273,7 @@
int netbits, /* -1 if host route, otherwise # of network bits in address */
bool primary)
{
- struct mroute_addr addr;
+ struct mroute_addr addr = {0};
addr.len = 16;
addr.type = MR_ADDR_IPV6;
@@ -3118,7 +3118,7 @@
void
multi_process_float(struct multi_context *m, struct multi_instance *mi)
{
- struct mroute_addr real;
+ struct mroute_addr real = {0};
struct hash *hash = m->hash;
struct gc_arena gc = gc_new();
@@ -3532,7 +3532,7 @@
if (BLEN(&m->top.c2.buf) > 0)
{
unsigned int mroute_flags;
- struct mroute_addr src, dest;
+ struct mroute_addr src = {0}, dest = {0};
const int dev_type = TUNNEL_TYPE(m->top.c1.tuntap);
int16_t vid = 0;
@@ -166,7 +166,7 @@
CK_RSA_PKCS_PSS_PARAMS pss_params = {0};
unsigned char buf[EVP_MAX_MD_SIZE];
- size_t buflen;
+ size_t buflen = 0;
size_t siglen_max = *siglen;
unsigned char enc[EVP_MAX_MD_SIZE + 32]; /* 32 bytes enough for DigestInfo header */
@@ -3301,7 +3301,7 @@
{
struct iovec iov;
uint8_t pktinfo_buf[PKTINFO_BUF_SIZE];
- struct msghdr mesg;
+ struct msghdr mesg = {0};
socklen_t fromlen = sizeof(from->dest.addr);
ASSERT(sock->sd >= 0); /* can't happen */
flichtenheld has uploaded this change for review. ( http://gerrit.openvpn.net/c/openvpn/+/318?usp=email ) Change subject: Fix various "Uninitialized scalar variable" warnings from Coverity ...................................................................... Fix various "Uninitialized scalar variable" warnings from Coverity These are all not actually problems, since the uninitialized parts are either .unused members of the struct (mroute_addr) or only written to (buflen), but still doesn't hurt to explicitely initialize them. Change-Id: I45cd0917d24570ae9e9db7eb6c370756e4595842 Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com> --- M src/openvpn/mudp.c M src/openvpn/multi.c M src/openvpn/pkcs11_openssl.c M src/openvpn/socket.c 4 files changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/18/318/1