From 8deef0b4bc14b41a14e19d1e8e11d57aca3d6875 Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Thu, 4 Oct 2018 12:19:25 +0100 Subject: [PATCH] MacOS: Fixed a memory access bug when handling MAC addresses --- modules/juce_core/native/juce_mac_Network.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/juce_core/native/juce_mac_Network.mm b/modules/juce_core/native/juce_mac_Network.mm index 5ea85d7e88..7e2b60ee8e 100644 --- a/modules/juce_core/native/juce_mac_Network.mm +++ b/modules/juce_core/native/juce_mac_Network.mm @@ -32,10 +32,10 @@ void MACAddress::findAllAddresses (Array& result) for (const ifaddrs* cursor = addrs; cursor != nullptr; cursor = cursor->ifa_next) { // Required to avoid misaligned pointer access - sockaddr_storage sto; - std::memcpy (&sto, cursor->ifa_addr, sizeof (sockaddr_storage)); + sockaddr sto; + std::memcpy (&sto, cursor->ifa_addr, sizeof (sockaddr)); - if (sto.ss_family == AF_LINK) + if (sto.sa_family == AF_LINK) { auto sadd = (const sockaddr_dl*) cursor->ifa_addr;