summaryrefslogtreecommitdiffstats
path: root/tc/p_icmp.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2007-10-12 14:01:13 +0200
committerStephen Hemminger <shemminger@linux-foundation.org>2007-10-12 15:45:12 -0700
commitca78b0e7d4042be7f7283d551d433b76da7f312b (patch)
treee57472fcdfbe45b26bb6b94399c4e77a2d06c924 /tc/p_icmp.c
parent5058332f3cd751cb0aa4970a0892ebc4b791b748 (diff)
Prevent renaming interfaces to empty string.
Andreas Henriksson wrote: > From: Alexander Wirt <formorer@debian.org> > > > Signed-off-by: Andreas Henriksson <andreas@fatal.se> > --- > ip/iplink.c | 4 ++++ > 1 files changed, 4 insertions(+), 0 deletions(-) > > diff --git a/ip/iplink.c b/ip/iplink.c > index 4060845..da1f64e 100644 > --- a/ip/iplink.c > +++ b/ip/iplink.c > @@ -670,6 +670,10 @@ static int do_set(int argc, char **argv) > } > > if (newname && strcmp(dev, newname)) { > + if (strlen(newname) == 0) { > + printf("\"\" is not valid device identifier\n"); > + return -1; > + } Indentation fixed, same change for the non-ioctl case, use invarg. While I'm at it I also fixed the error message for "name too long", *argv is NULL at this point. Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'tc/p_icmp.c')
0 files changed, 0 insertions, 0 deletions