From: Yu Watanabe Date: Mon, 4 Mar 2019 02:24:33 +0000 (+0900) Subject: netlink: check new interface name is valid or not before sending request X-Git-Tag: v242-rc1~198^2~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4d64309955fe6543b5bbf9c2c7da81a7ea8da9d3;p=thirdparty%2Fsystemd.git netlink: check new interface name is valid or not before sending request --- diff --git a/src/libsystemd/sd-netlink/netlink-util.c b/src/libsystemd/sd-netlink/netlink-util.c index 3928dfbabf3..628ce507a05 100644 --- a/src/libsystemd/sd-netlink/netlink-util.c +++ b/src/libsystemd/sd-netlink/netlink-util.c @@ -13,6 +13,9 @@ int rtnl_set_link_name(sd_netlink **rtnl, int ifindex, const char *name) { assert(ifindex > 0); assert(name); + if (!ifname_valid(name)) + return -EINVAL; + if (!*rtnl) { r = sd_netlink_open(rtnl); if (r < 0)