netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2-next v1] tc_util: Change datatype for maj to avoid overflow issue
@ 2022-11-21  2:29 Lai Peter Jun Ann
  2022-11-23 15:54 ` Simon Horman
  2022-11-23 17:00 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Lai Peter Jun Ann @ 2022-11-21  2:29 UTC (permalink / raw)
  To: netdev
  Cc: David Ahern, Stephen Hemminger, Vinicius Costa Gomes,
	Jamal Hadi Salim, Cong Wang, Jiri Pirko,
	Muhammad Husaini Zulkifli, Lai Peter Jun Ann

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>
---
 tc/tc_util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tc/tc_util.c b/tc/tc_util.c
index 44137ad..f8d9c88 100644
--- a/tc/tc_util.c
+++ b/tc/tc_util.c
@@ -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;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-23 17:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-21  2:29 [PATCH iproute2-next v1] tc_util: Change datatype for maj to avoid overflow issue Lai Peter Jun Ann
2022-11-23 15:54 ` Simon Horman
2022-11-23 17:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).