mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Fix persistent local flag on filename zend_strings in phar (#17353)
This fixes the nightly failure.
This commit is contained in:
@@ -1182,6 +1182,9 @@ static zend_result phar_parse_pharfile(php_stream *fp, char *fname, size_t fname
|
||||
}
|
||||
|
||||
entry.filename = zend_string_init(filename_raw, filename_len, entry.is_persistent);
|
||||
if (entry.is_persistent) {
|
||||
GC_MAKE_PERSISTENT_LOCAL(entry.filename);
|
||||
}
|
||||
|
||||
PHAR_GET_32(buffer, len);
|
||||
if (len > (size_t)(endbuffer - buffer)) {
|
||||
|
||||
@@ -374,6 +374,9 @@ bail:
|
||||
return FAILURE;
|
||||
}
|
||||
entry.filename = zend_string_alloc(entry.uncompressed_filesize, myphar->is_persistent);
|
||||
if (myphar->is_persistent) {
|
||||
GC_MAKE_PERSISTENT_LOCAL(entry.filename);
|
||||
}
|
||||
ZSTR_VAL(entry.filename)[entry.uncompressed_filesize] = '\0';
|
||||
|
||||
read = php_stream_read(fp, ZSTR_VAL(entry.filename), entry.uncompressed_filesize);
|
||||
@@ -440,6 +443,9 @@ bail:
|
||||
}
|
||||
|
||||
entry.filename = zend_string_init(name, filename_len, myphar->is_persistent);
|
||||
if (myphar->is_persistent) {
|
||||
GC_MAKE_PERSISTENT_LOCAL(entry.filename);
|
||||
}
|
||||
} else if (!last_was_longlink) {
|
||||
/* calculate strlen, which can be no longer than 100 */
|
||||
uint32_t filename_len;
|
||||
@@ -455,6 +461,9 @@ bail:
|
||||
}
|
||||
|
||||
entry.filename = zend_string_init(hdr->name, filename_len, myphar->is_persistent);
|
||||
if (myphar->is_persistent) {
|
||||
GC_MAKE_PERSISTENT_LOCAL(entry.filename);
|
||||
}
|
||||
}
|
||||
last_was_longlink = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user