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 <ferry.huberts@pelagic.nl>
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;