Skip to content

Avoid string duplications in ZEND_INI_MH(OnUpdateBaseDir)#20780

Draft
ndossche wants to merge 2 commits intophp:masterfrom
ndossche:on-update-basedir
Draft

Avoid string duplications in ZEND_INI_MH(OnUpdateBaseDir)#20780
ndossche wants to merge 2 commits intophp:masterfrom
ndossche:on-update-basedir

Conversation

@ndossche
Copy link
Copy Markdown
Member

No description provided.

@ndossche ndossche requested a review from bukka as a code owner December 26, 2025 00:05
@ndossche ndossche marked this pull request as draft December 26, 2025 00:28
Comment thread main/fopen_wrappers.c
zend_string *tmp = smart_str_extract(&buf);
char *result = estrdup(ZSTR_VAL(tmp));
smart_string_0(&buf);
char *result = buf.c;
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.

Shouldn't we maybe store the global as a zend_string? Surely open_dir checks require to know the length of the value? In which case we would need to change back to the smart_str API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants