Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace unsafe.Slice with memory copying to avoid potential fault memory issue #6664

Merged
merged 1 commit into from
Sep 14, 2024

Commits on Sep 14, 2024

  1. Replace unsafe.Slice with memory copying to avoid potential fault mem…

    …ory issue
    
    * Refactored ListIPForwardRows to copy IP forwarding table rows.
    * Removed unsafe.Slice and replaced with manual pointer dereferencing and copying.
    
    This change addresses a potential fault memory issue when iterating through the IP forwarding table,
    caused by the use of slices after corresponding memory has been freed, leading to access failure.
    
    Signed-off-by: Shuyang Xin <[email protected]>
    Signed-off-by: Wenying Dong <[email protected]>
    XinShuYang committed Sep 14, 2024
    Configuration menu
    Copy the full SHA
    10ba34b View commit details
    Browse the repository at this point in the history