From: Stephen Hemminger Date: Fri, 12 Oct 2007 21:43:03 +0000 (-0700) Subject: don't allow "" for device name X-Git-Tag: v2.6.23-071016~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba371d989038e0dda803528c194e12e5177f7008;p=thirdparty%2Fiproute2.git don't allow "" for device name If a zero-length string is given, it is not rejected by netlink in kernel so catch it at command line. Signed-off-by: Stephen Hemminger --- diff --git a/ip/iplink.c b/ip/iplink.c index 4060845cc..82275b4e1 100644 --- a/ip/iplink.c +++ b/ip/iplink.c @@ -336,6 +336,8 @@ static int iplink_modify(int cmd, unsigned int flags, int argc, char **argv) if (name) { len = strlen(name) + 1; + if (len == 1) + invarg("null string is not valid name\n"); if (len > IFNAMSIZ) invarg("\"name\" too long\n", *argv); addattr_l(&req.n, sizeof(req), IFLA_IFNAME, name, len);