thom311 / libnl

Netlink Library Suite
GNU Lesser General Public License v2.1
419 stars 313 forks source link

route/link: prevent segfault in af_request_type() #333

Closed TarEnethil closed 1 year ago

TarEnethil commented 1 year ago

ac_request_type() in route/link.c will segfault if the function pointer ops->ao_override_rtm has not been initialized for the given af_type parameter.

The bug was found while trying to call rtnl_link_change() for a link with family type AF_INET6. It seems this bug was introduced in 3c427d0.

Fix: check that ao_override_rtm is a valid pointer before calling it.

thom311 commented 1 year ago

merged to main. Thank you for your patch, and sorry for the long time...