getsyshwaddr assumed that the first ifaddr it came across was the MAC address, and as such assumes that it has the right length. After upgrading to OS X 10.13.4, this causes minidlnad to crash on startup due to tripping stack smash protection -- I'm not sure if the order of addresses returned previously happened to accidentally hit this invariant, or if this was always an issue and the stack smash protection got smarter. In any event, we just need to look for the AF_LINK address and use that. As an extra check, we make sure the length is the length we expect to copy into the target buffer.
10 KiB
10 KiB