Skip to content

Fix GH-13836: Renaming a file in a Phar to an already existing filename causes a NULL pointer dereference #13840

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

If the destination already exists, then the add function on the manifest will return NULL, resulting in a NULL entry and therefore a NULL deref. As copy() (not Phar::copy) chooses to succeed and overwrite the destination if it already exists, we should do the same. Therefore the fix is as simple as changing add to update.

…ename causes a NULL pointer dereference

If the destination already exists, then the `add` function on the
manifest will return NULL, resulting in a NULL entry and therefore a
NULL deref. As `copy()` (not `Phar::copy`) chooses to succeed and
overwrite the destination if it already exists, we should do the same.
Therefore the fix is as simple as changing `add` to `update`.
@nielsdos nielsdos closed this in ed8ed71 Mar 30, 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.

Renaming a file in a Phar to an already existing filename causes a NULL pointer dereference
2 participants