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

Fix out of bounds issue in is_native_addr_in_shared_heap function #3886

Merged
merged 1 commit into from
Oct 31, 2024

Commits on Oct 29, 2024

  1. Fix out of bounds issue in is_native_addr_in_shared_heap function

    When checking for integer overflow, you may often write tests like p + i < p.
    This works fine if p and i are unsigned integers, since any overflow in the
    addition will cause the value to simply "wrap around." However, using this
    pattern when p is a pointer is problematic because pointer overflow has
    undefined behavior according to the C and C++ standards. If the addition
    overflows and has an undefined result, the comparison will likewise be
    undefined; it may produce an unintended result, or may be deleted entirely
    by an optimizing compiler.
    lum1n0us committed Oct 29, 2024
    Configuration menu
    Copy the full SHA
    80fd2ef View commit details
    Browse the repository at this point in the history