Skip to content

Commit

Permalink
Fixed usage of uninitialised ifreq (#2954)
Browse files Browse the repository at this point in the history
Signed-off-by: Tomoya Fujita <[email protected]>

Signed-off-by: Tomoya Fujita <[email protected]>
  • Loading branch information
fujitatomoya authored Sep 15, 2022
1 parent 7ccc7a7 commit 5ec47db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cpp/utils/IPFinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5ec47db

Please sign in to comment.