aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Kleen <andi@firstfloor.org>2003-09-11 03:46:49 +0000
committerAndi Kleen <andi@firstfloor.org>2003-09-11 03:46:49 +0000
commitaac294c865db776ea63ac4e8cd80d98dfd647f14 (patch)
treee5d1820560610f8c5548f0cee6b1771f90cff399 /nameif.c
parentUse new style MII ioctls only. This will give you a warning, if compiled (diff)
downloadnet-tools-aac294c865db776ea63ac4e8cd80d98dfd647f14.tar.gz
net-tools-aac294c865db776ea63ac4e8cd80d98dfd647f14.tar.bz2
net-tools-aac294c865db776ea63ac4e8cd80d98dfd647f14.zip
Fix off by one in name length checking
Diffstat (limited to 'nameif.c')
-rw-r--r--nameif.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/nameif.c b/nameif.c
index d427b3e..04658c5 100644
--- a/nameif.c
+++ b/nameif.c
@@ -3,7 +3,7 @@
* Writen 2000 by Andi Kleen.
* Subject to the Gnu Public License, version 2.
* TODO: make it support token ring etc.
- * $Id: nameif.c,v 1.3 2003/03/06 23:26:52 ecki Exp $
+ * $Id: nameif.c,v 1.4 2003/09/11 03:46:49 ak Exp $
*/
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
@@ -175,7 +175,7 @@ void readconf(void)
if (*p == '\0')
continue;
n = strcspn(p, " \t");
- if (n > IFNAMSIZ)
+ if (n > IFNAMSIZ-1)
complain(_("interface name too long at line %d"), line);
memcpy(ch->ifname, p, n);
ch->ifname[n] = 0;