From: Yu Watanabe Date: Thu, 10 Jun 2021 09:16:28 +0000 (+0900) Subject: netlink: check input name is valid before calling netlink method X-Git-Tag: v249-rc1~28^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57bd6aa7019734f599e23bdd75d6a75629df3aa6;p=thirdparty%2Fsystemd.git netlink: check input name is valid before calling netlink method --- diff --git a/src/libsystemd/sd-netlink/netlink-util.c b/src/libsystemd/sd-netlink/netlink-util.c index 0650f0b4752..4012725f4cd 100644 --- a/src/libsystemd/sd-netlink/netlink-util.c +++ b/src/libsystemd/sd-netlink/netlink-util.c @@ -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) {