xfangfang / borealis

Hardware accelerated, Nintendo Switch inspired UI library for PC, Android, iOS, PSV, PS4 and Nintendo Switch
Apache License 2.0
31 stars 21 forks source link

platform/desktop: Fix potential null pointer dereference in getIpAddress #35

Closed mochaaP closed 11 months ago

mochaaP commented 11 months ago

According to getifaddrs(3):

The ifa_addr field points to a structure containing the interface address. (The sa_family subfield should be consulted to determine the format of the address structure.) This field may contain a null pointer.

mochaaP commented 11 months ago

I can reproduce this with Tailscale's TUN on Fedora 40 (rawhide). image

mochaaP commented 11 months ago

:thinking: We should probably only include PHYSICAL interfaces for this?

Weirdly, this only happens with Tailscale's TUN implementation. Others are not affected

mochaaP commented 11 months ago

image I think I found the culprit

xfangfang commented 11 months ago

Good catch !