diff --git a/ChangeLog b/ChangeLog index 68efd800..f3560c66 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-02-07 Stephen Hemminger + + * Validate classid is not too large to cause loss of bits. + 2005-02-07 Jean-Marc Ranger * need to call getline() with null for first usage diff --git a/tc/tc_util.c b/tc/tc_util.c index 0dc76c03..a6413e66 100644 --- a/tc/tc_util.c +++ b/tc/tc_util.c @@ -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;