Skip to contentSkip to conversation

tc_util: Change datatype for maj to avoid overflow issue

PATCH Applied Lai Peter Jun Ann 3 participants 3 messages Nov 21, 2022 – Nov 23, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tc_util: Change datatype for maj to avoid overflow issue

The return value by stroul() is unsigned long int. Hence the datatype for maj should defined as unsigned long to avoid overflow issue.

---
 tc/tc_util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tc/tc_util.c +1 -1
index 44137ad..f8d9c88 100644
@@ -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;
Signature · 1 line
1.9.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Lai Peter Jun Ann

[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

The return value by stroul() is unsigned long int. Hence the datatype for maj should defined as unsigned long to avoid overflow issue.

#2 lore raw
In reply to Lai Peter Jun Ann
This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:

Hello:

This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:

Quoted 8 lines · On Mon, 21 Nov 2022 10:29:09 +0800 you wrote:

The return value by stroul() is unsigned long int. Hence the datatype for maj should defined as unsigned long to avoid overflow issue.

---
 tc/tc_util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
- [iproute2-next,v1] tc_util: Change datatype for maj to avoid overflow issue

    https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=455fa8295298

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html