Skip to content

ext/phar: continue process of using zend_string* for alias arguments#21932

Open
Girgias wants to merge 4 commits intophp:masterfrom
Girgias:2026-04-phar-open-or-create-filename-zstr
Open

ext/phar: continue process of using zend_string* for alias arguments#21932
Girgias wants to merge 4 commits intophp:masterfrom
Girgias:2026-04-phar-open-or-create-filename-zstr

Conversation

@Girgias
Copy link
Copy Markdown
Member

@Girgias Girgias commented May 2, 2026

Commits should be reviewed in order.

Girgias added 4 commits May 2, 2026 17:13
As we want to use it to lookup hash tables and in the future copy it.
Required removing some const qualifiers on zend_string* and propagate the change to simplify the code.
@Girgias Girgias force-pushed the 2026-04-phar-open-or-create-filename-zstr branch from 5273abe to 251a774 Compare May 2, 2026 16:14
Comment thread ext/phar/phar_object.c
zend_string *fname;
char *alias = NULL, *error;
size_t alias_len = 0;
zend_string *alias;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you probably need to initialise alias since it is optional.

Comment thread ext/phar/phar.c

if (alias_len && alias) {
if (NULL == zend_hash_str_add_ptr(&(PHAR_G(phar_alias_map)), alias, alias_len, mydata)) {
if (alias) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note there is subtle change of behaviour throughout. i.e. empty values are potentially accepted ?

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.

2 participants