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: null array indexing in CTracer_handle_return #1843

Merged
merged 1 commit into from
Sep 3, 2024

Commits on Sep 2, 2024

  1. fix: null array indexing in CTracer_handle_return

    CTracer_set_pdata_stack can initialize self.pdata_stack to an empty
    stack where ->stack is NULL and ->deph is -1.
    
    Move index into ->stack into ->depth>=0 check to avoid indexing into
    NULL array.
    
    This issue was found running UndefinedBehaviourSanitizer. It's
    reproducible in regular test runs, e.g. `python3 -m tox -e py311`.
    Adding `if (self->pdata_stack->stack == NULL) { fprint(...) }` before
    the moved line shows the issue in several test cases.
    frigus02 committed Sep 2, 2024
    Configuration menu
    Copy the full SHA
    54f796a View commit details
    Browse the repository at this point in the history