From 31e81b49468fadbf71b07e4b9ec6f9213107b966 Mon Sep 17 00:00:00 2001 From: Ferry Huberts Date: Sat, 9 Aug 2014 12:33:22 +0200 Subject: [PATCH] p2pd: fir compile warning, initialise ipHeader MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When compiling with the address sanitiser, got [CC] src/p2pd.c src/p2pd.c: In function ‘DoP2pd’: src/p2pd.c:629:18: warning: ‘ipHeader’ may be used uninitialized in this function [-Wmaybe-uninitialized] nwords = header->ip_hl << 1; ^ src/p2pd.c:663:14: note: ‘ipHeader’ was declared here struct ip *ipHeader; /* The IP header inside the captured IP packet */ ^ Signed-off-by: Ferry Huberts --- lib/p2pd/src/p2pd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/p2pd/src/p2pd.c b/lib/p2pd/src/p2pd.c index 6e3f98ce..e0e920b3 100644 --- a/lib/p2pd/src/p2pd.c +++ b/lib/p2pd/src/p2pd.c @@ -660,7 +660,7 @@ static void P2pdPacketCaptured(unsigned char *encapsulationUdpData, int nBytes) { union olsr_ip_addr dst; /* Destination IP address in captured packet */ - struct ip *ipHeader; /* The IP header inside the captured IP packet */ + struct ip *ipHeader = NULL; /* The IP header inside the captured IP packet */ struct ip6_hdr *ipHeader6; /* The IP header inside the captured IP packet */ struct udphdr *udpHeader; uint8_t * ttl = NULL; -- 2.20.1