From: Yu Watanabe Date: Tue, 16 May 2023 02:46:11 +0000 (+0900) Subject: udev/net: verify ID_NET_XYZ before trying to assign it as an alternative name X-Git-Tag: v254-rc1~463^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e65c6c1baa8ea905f7e5bad3b8486d509775ec6a;p=thirdparty%2Fsystemd.git udev/net: verify ID_NET_XYZ before trying to assign it as an alternative name --- diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c index 4c83eede7aa..e5f1220928c 100644 --- a/src/udev/net/link-config.c +++ b/src/udev/net/link-config.c @@ -836,7 +836,7 @@ static int link_apply_alternative_names(Link *link, sd_netlink **rtnl) { default: assert_not_reached(); } - if (!isempty(n)) { + if (ifname_valid_full(n, IFNAME_VALID_ALTERNATIVE)) { r = strv_extend(&altnames, n); if (r < 0) return log_oom();