netlink: check input name is valid before calling netlink method

This commit is contained in:
Yu Watanabe 2021-06-10 18:16:28 +09:00
parent f6e491547d
commit 57bd6aa701

View file

@ -274,6 +274,9 @@ int rtnl_resolve_link_alternative_name(sd_netlink **rtnl, const char *name) {
assert(name);
if (!ifname_valid_full(name, IFNAME_VALID_ALTERNATIVE))
return -EINVAL;
if (!rtnl)
rtnl = &our_rtnl;
if (!*rtnl) {