-
Notifications
You must be signed in to change notification settings - Fork 10
Description
Problem/Opportunity
Vlan_SetMacAddr in valn_apis.c forced type conversion out of bounds when do Vlan_GetEthLinkMacOffset to forced int add to ULONG add tranversion.
Steps to reproduce
1 supposed the mac get in platform_hal_GetBaeMacAddress is "00:33:44:22:00:88"
2 number will be 3344220088
3 after do Vlan_GetEthLinkMacOffSet, the add is forced to transversion to ULONG type, supposed the add is 0
4 print the number value ,it will be 3300000000, because four bytes of number were overwritten by the forced type conversion of add.
Expected Behavior
1 supposed the mac get in platform_hal_GetBaeMacAddress is "00:33:44:22:00:88"
2 number will be 3344220088
3 after do Vlan_GetEthLinkMacOffSet
4 print the number value ,it should still be 3344220088
Actual Behavior
1 supposed the mac get in platform_hal_GetBaeMacAddress is "00:33:44:22:00:88"
2 number will be 3344220088
3 after do Vlan_GetEthLinkMacOffSet, the add is forced to transversion to ULONG type, supposed the add is 0
4 print the number value ,it will be 3300000000, because four bytes of number were overwritten by the forced type conversion of add.
Notes (Optional)
No response