diff --git a/src/posix/platform/netif.cpp b/src/posix/platform/netif.cpp index a19dd7d77..c53dcf2f4 100644 --- a/src/posix/platform/netif.cpp +++ b/src/posix/platform/netif.cpp @@ -464,7 +464,7 @@ static void processMLDEvent(otInstance *aInstance) uint8_t buffer[kMaxMLDEvent]; ssize_t bufferLen = -1; struct sockaddr_in6 srcAddr; - socklen_t addrLen; + socklen_t addrLen = sizeof(srcAddr); bool fromSelf = false; MLDv2Header * hdr = reinterpret_cast(buffer); size_t offset;