]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tc_util: Change datatype for maj to avoid overflow issue
authorLai Peter Jun Ann <jun.ann.lai@intel.com>
Mon, 21 Nov 2022 02:29:09 +0000 (10:29 +0800)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 23 Nov 2022 16:54:44 +0000 (08:54 -0800)
The return value by stroul() is unsigned long int. Hence the datatype
for maj should defined as unsigned long to avoid overflow issue.

Signed-off-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>
Signed-off-by: Lai Peter Jun Ann <jun.ann.lai@intel.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
tc/tc_util.c

index 334334db6cd40bc78f340c84ef99016ed4f9c923..8cd3c03578272059d888fac6993e32f5ef1a29eb 100644 (file)
@@ -74,7 +74,7 @@ const char *get_tc_lib(void)
 
 int get_qdisc_handle(__u32 *h, const char *str)
 {
-       __u32 maj;
+       unsigned long maj;
        char *p;
 
        maj = TC_H_UNSPEC;