]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
netlink: check input name is valid before calling netlink method
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 10 Jun 2021 09:16:28 +0000 (18:16 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 11 Jun 2021 18:19:08 +0000 (03:19 +0900)
src/libsystemd/sd-netlink/netlink-util.c

index 0650f0b47523b8463abc789a47bfdb4f958c1a34..4012725f4cd3e62a06e931d7afb08b47d6805356 100644 (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) {