From 6396c33402b0072867b51e4c1b7ecb2a25814bee Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sun, 19 Apr 2020 05:57:21 +0000 Subject: [PATCH] avoid possible use of uninitialized intf_addr in nmrp_do() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Silences a warning by gcc: . nmrp.c:462:7: warning: ‘intf_addr’ may be used uninitialized in this function [-Wmaybe-uninitialized] 462 | if (ethsock_ip_add(sock, intf_addr, ipmask.s_addr, &ip_undo) != 0) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- nmrp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nmrp.c b/nmrp.c index 4f262d9..079271a 100644 --- a/nmrp.c +++ b/nmrp.c @@ -360,7 +360,7 @@ int nmrp_do(struct nmrpd_args *args) struct ethsock *sock; struct ethsock_ip_undo *ip_undo = NULL; struct ethsock_arp_undo *arp_undo = NULL; - uint32_t intf_addr; + uint32_t intf_addr = 0; void (*sigh_orig)(int); struct in_addr ipaddr; struct in_addr ipmask; -- 2.25.1