netlink: check input name is valid before calling netlink method

This commit is contained in:
Yu Watanabe
2021-06-12 03:19:08 +09:00
parent f6e491547d
commit 57bd6aa701
+3
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) {