validate classid

(Logical change 1.137)
This commit is contained in:
osdl.net!shemminger 2005-02-07 18:16:29 +00:00
parent 2f3c04227e
commit a8b303cc3f
2 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2005-02-07 Stephen Hemminger <shemminger@dxpl.pdx.osdl.net>
* Validate classid is not too large to cause loss of bits.
2005-02-07 Jean-Marc Ranger <jmranger@sympatico.ca>
* need to call getline() with null for first usage

View File

@ -61,11 +61,15 @@ int get_tc_classid(__u32 *h, const char *str)
return -1;
}
if (*p == ':') {
if (maj >= (1<<16))
return -1;
maj <<= 16;
str = p+1;
min = strtoul(str, &p, 16);
if (*p != 0)
return -1;
if (min >= (1<<16))
return -1;
maj |= min;
} else if (*p != 0)
return -1;