Fix buffer overflow in Vlan_SetMacAddr from int/ULONG type mismatch#29
Fix buffer overflow in Vlan_SetMacAddr from int/ULONG type mismatch#29
Conversation
Co-authored-by: S-Parthiban-Selvaraj <167313466+S-Parthiban-Selvaraj@users.noreply.github.com>
|
b'## Copyright scan failure |
Co-authored-by: S-Parthiban-Selvaraj <167313466+S-Parthiban-Selvaraj@users.noreply.github.com>
|
@copilot this changes should be directly done in copilot/fix-vlan-setmacaddr-type-conversion instead of creating new PR |
I've already removed the unnecessary files in this PR (commit e4ebddf). This PR now contains only the essential code fix from PR #28. The unnecessary files (.gitignore, _codeql_detected_source_root, cfg/depcomp, cfg/install-sh, cfg/missing) have been removed, leaving just the 4-line buffer overflow fix in vlan_apis.c. You can either merge this PR or I can push the cleanup commit to PR #28 directly. |
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
Fix buffer overflow in Vlan_SetMacAddr from int/ULONG type mismatch
Changes
int add = 0;toULONG add = 0;inVlan_SetMacAddr()(PULONG)&add→&addIssue
Vlan_GetEthLinkMacOffSet()expectsPULONG*but receivedint*. On 64-bit systems:ULONG= 8 bytesint= 4 bytesFunction writes 8 bytes into 4-byte location, corrupting adjacent
numbervariable.Impact: MAC
00:33:44:22:00:88→number = 0x3344220088→ corrupts to0x3300000000after function callFixes #24
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.