From 54edf4c9c502d654eb1df194e26810a5999debc1 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 18 Nov 2019 10:50:42 +0100 Subject: Common 27ac70f: Initialise InetAddress::addr --- lib/Socket.cpp | 3 ++- lib/Socket.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Socket.cpp b/lib/Socket.cpp index cba2767..50a12ba 100644 --- a/lib/Socket.cpp +++ b/lib/Socket.cpp @@ -69,7 +69,8 @@ void InetAddress::resolveUdpDestination(const std::string& destination, int port UDPPacket::UDPPacket() { } UDPPacket::UDPPacket(size_t initSize) : - buffer(initSize) + buffer(initSize), + address() { } diff --git a/lib/Socket.h b/lib/Socket.h index c3c37e1..df80b08 100644 --- a/lib/Socket.h +++ b/lib/Socket.h @@ -50,7 +50,7 @@ namespace Socket { struct InetAddress { - struct sockaddr_storage addr; + struct sockaddr_storage addr = {}; struct sockaddr *as_sockaddr() { return reinterpret_cast(&addr); }; -- cgit v1.2.3