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 GH-14639: Member access within null pointer in ext/spl/spl_observer.c #14849

Closed
wants to merge 1 commit into from

Commits on Jul 6, 2024

  1. Fix phpGH-14639: Member access within null pointer in ext/spl/spl_obs…

    …erver.c
    
    `spl_object_storage_attach_handle` creates an entry already, but only
    fills it in at the end with `spl_object_storage_create_element` which
    allocates memory. In this case the allocation fails and we're left with
    a NULL slot. Doing the allocation first isn't an option because we want
    to check whether the slot is occupied before allocating memory.
    The simplest solution is to set the entry to NULL and check for a NULL
    pointer upon destruction.
    nielsdos committed Jul 6, 2024
    Configuration menu
    Copy the full SHA
    f04517a View commit details
    Browse the repository at this point in the history