Skip to content

Conversation

Copy link

Copilot AI commented Nov 19, 2025

Fix buffer overflow in Vlan_SetMacAddr from int/ULONG type mismatch

Changes

  • Type mismatch fix: Changed int add = 0; to ULONG add = 0; in Vlan_SetMacAddr()
  • Removed incorrect cast: (PULONG)&add&add

Issue

Vlan_GetEthLinkMacOffSet() expects PULONG* but received int*. On 64-bit systems:

  • ULONG = 8 bytes
  • int = 4 bytes

Function writes 8 bytes into 4-byte location, corrupting adjacent number variable.

// Before - causes corruption
int add = 0;
if (Vlan_GetEthLinkMacOffSet(pEntry, (PULONG)&add) == ANSC_STATUS_FAILURE)

// After - correct type
ULONG add = 0;
if (Vlan_GetEthLinkMacOffSet(pEntry, &add) == ANSC_STATUS_FAILURE)

Impact: MAC 00:33:44:22:00:88number = 0x3344220088 → corrupts to 0x3300000000 after function call

Fixes #24

Original prompt

remove unnecessory new files generated by copiolot in #28 Pull request. Do only the necessory code change


💡 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.

Co-authored-by: S-Parthiban-Selvaraj <167313466+S-Parthiban-Selvaraj@users.noreply.github.com>
@rdkcmf-jenkins
Copy link
Contributor

b'## Copyright scan failure
Commit: 1f2421f
Report detail: https://gist.github.com/rdkcmf-jenkins/c666d5e47d5d6a6fa80926385fd103bf'

Co-authored-by: S-Parthiban-Selvaraj <167313466+S-Parthiban-Selvaraj@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove unnecessary new files generated by Copilot Fix buffer overflow in Vlan_SetMacAddr from int/ULONG type mismatch Nov 19, 2025
@S-Parthiban-Selvaraj
Copy link
Contributor

@copilot this changes should be directly done in copilot/fix-vlan-setmacaddr-type-conversion instead of creating new PR

Copy link
Author

Copilot AI commented Nov 19, 2025

@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.

@github-actions
Copy link


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vlan_SetMacAddr forced type conversion out of bounds

3 participants