Skip to content

Fix GH-13833: Applying zero offset to null pointer in zend_hash.c #13847

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

Closed
wants to merge 1 commit into from

Conversation

nielsdos
Copy link
Member

@nielsdos nielsdos commented Mar 31, 2024

MAPPHAR_FAIL will call the destructor of the manifest, mounted_dirs, and virtual_dirs tables. When a new phar object is allocated using (p)ecalloc, the bytes are zeroed, but the flag for an uninitialized table is non-zero. So we have to manually set the flag in case that we have a code path that can destroy the tables without first initializing them at least once.

Diff looks a bit strange because of the github issue renumbering in the file names...

MAPPHAR_FAIL will call the destructor of the manifest, mounted_dirs, and
virtual_dirs tables. When a new phar object is allocated using (p)ecalloc,
the bytes are zeroed, but the flag for an uninitialized table is
non-zero. So we have to manually set the flag in case that we have a
code path that can destroy the tables without first initializing them at
least once.
@nielsdos nielsdos linked an issue Mar 31, 2024 that may be closed by this pull request
@nielsdos nielsdos closed this in 47bb6c1 Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Applying zero offset to null pointer in zend_hash.c
2 participants