ext/phar: use zend_string* instead of a char* + size_t pair#21827
Draft
Girgias wants to merge 11 commits intophp:masterfrom
Draft
ext/phar: use zend_string* instead of a char* + size_t pair#21827Girgias wants to merge 11 commits intophp:masterfrom
Girgias wants to merge 11 commits intophp:masterfrom
Conversation
Convert relevant cache global to zend_string as well. This is in preparation for future refactorings to convert functions taking a char* + size_t pair to zend_string*
Also clean-up the freeing code for the arch zend_string, we don't need to actually save the fname zend_string as it is not used afterwards
devnexen
reviewed
Apr 22, 2026
|
|
||
| entry->inode = (unsigned short) zend_hash_func(tmp, tmp_len); | ||
| } else { | ||
| entry->inode = (unsigned short) zend_string_hash_func(entry->filename); |
Member
There was a problem hiding this comment.
noted the shift here as it s not capped to MAXPATHLEN.
| @@ -410,8 +407,8 @@ void phar_destroy_phar_data(phar_archive_data *phar); | |||
|
|
|||
| ZEND_ATTRIBUTE_NONNULL zend_result phar_postprocess_file(phar_entry_data *idata, uint32_t crc32, char **error, int process_zip); | |||
| zend_result phar_open_from_filename(char *fname, size_t fname_len, char *alias, size_t alias_len, uint32_t options, phar_archive_data** pphar, char **error); | |||
Member
There was a problem hiding this comment.
isn't it worth using zend_string * as well as its counterpart phar_open_or_create_filename ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #21823
Commits should be reviewed individually.
This is the first batch of refactorings, as others are "blocked" by the cache list INI setting that should be converted from a char* to zend_string* too.