Skip to content

ext/phar: always free phar_archive_data->alias field if present#21820

Merged
Girgias merged 2 commits intophp:masterfrom
Girgias:2026-04-phar-alias-freeing
Apr 21, 2026
Merged

ext/phar: always free phar_archive_data->alias field if present#21820
Girgias merged 2 commits intophp:masterfrom
Girgias:2026-04-phar-alias-freeing

Conversation

@Girgias
Copy link
Copy Markdown
Member

@Girgias Girgias commented Apr 21, 2026

This field is only ever assigned a newly allocated char* or NULL, as such it can never be equal to the phar_archive_data->fname field

This field is only ever assigned a newly allocated char* or NULL, as such it can never be equal to the phar_archive_data->fname field
@Girgias Girgias marked this pull request as ready for review April 21, 2026 15:51
@Girgias Girgias merged commit c0d0212 into php:master Apr 21, 2026
19 checks passed
@Girgias Girgias deleted the 2026-04-phar-alias-freeing branch April 21, 2026 15:53
jordikroon added a commit to jordikroon/php-src that referenced this pull request Apr 21, 2026
* master: (26 commits)
  Fix usage of optimize attribute on unsupported compilers (phpGH-21819)
  PHP 8.4 is now for PHP 8.4.22-dev
  ext/phar: remove `phar_archive_data->alias == phar_archive_data->fname` checks (php#21820)
  [skip ci] Mark curl/bug71523.phpt as online test
  [skip ci] Sort paths-ignore and remove cirrus
  [skip ci] Tweak paths-ignore
  ext/standard: Throw a ValueError when the parameter includes NUL bytes in `putenv` and `getenv` (php#21817)
  ext/session: fix missing zval_ptr_dtor for retval in PS_GC_FUNC(user)
  [skip ci] Backport CI changes
  ext/gmp: reject values larger than unsigned long in gmp_pow/binomial/root/rootrem and shift/pow operators.
  Update NEWS for recent bug fixes
  ext/phar: Fix memory leak in phar_verify_signature() when md_ctx is invalid
  phar: propagate phar_stream_flush return value from phar_stream_close
  phar: call phar_entry_delref before goto finish in phar_add_file error paths
  phar: free is_temp_dir entry before rejecting .phar/* paths in offsetGet
  phar: fix NULL dereference in Phar::webPhar() when SCRIPT_NAME is absent
  phar: restore is_link handler in phar_intercept_functions_shutdown
  ext/session: improve parsing of session.cookie_lifetime (php#21704)
  /ext/standard: Check for empty string in linkinfo() (php#21793)
  [Windows] Improve clang-cl support (php#21618)
  ...
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.

1 participant