pothosware / SoapyNetSDR

SoapySDR Support Module for NetSDR protocol
https://github.com/pothosware/SoapyNetSDR/wiki
MIT License
3 stars 2 forks source link

Fix segfault caused by dereferencing NULL pointer in interfaceList() #13

Closed ryanvolz closed 1 year ago

ryanvolz commented 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.

Fixes #6 for me.

zuckschwerdt commented 1 year ago

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.