Commit a8b303cc authored by osdl.net!shemminger's avatar osdl.net!shemminger

validate classid

(Logical change 1.137)
parent 2f3c0422
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
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment