Closed ryanvolz closed 1 year ago
The getifaddrs function can return structures where the ifa_addr field is NULL (according to the man page). This adds a check for that before attempting anything else.
getifaddrs
ifa_addr
NULL
Fixes #6 for me.
Good catch. Indeed getifaddrs(3) describes:
The ifa_addr field points to a structure containing the interface address. [...] This field may contain a null pointer.
The
getifaddrs
function can return structures where theifa_addr
field isNULL
(according to the man page). This adds a check for that before attempting anything else.Fixes #6 for me.