From 5ec47dbb1aab4866b16d3ad71373e2d61d928145 Mon Sep 17 00:00:00 2001 From: Tomoya Fujita Date: Thu, 15 Sep 2022 12:13:52 -0700 Subject: [PATCH] Fixed usage of uninitialised ifreq (#2954) Signed-off-by: Tomoya Fujita Signed-off-by: Tomoya Fujita --- src/cpp/utils/IPFinder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpp/utils/IPFinder.cpp b/src/cpp/utils/IPFinder.cpp index 1d39214504e..2611f664347 100644 --- a/src/cpp/utils/IPFinder.cpp +++ b/src/cpp/utils/IPFinder.cpp @@ -335,7 +335,7 @@ bool IPFinder::getAllMACAddress( IPFinder::getIPs(&ips); for (auto& ip : ips) { - struct ifreq ifr; + struct ifreq ifr = {}; strncpy(ifr.ifr_name, ip.dev.c_str(), sizeof(ifr.ifr_name) - 1); int fd = socket(PF_INET, SOCK_DGRAM, 0); if (fd == -1)