Commit 7c0b41ed3ef for php
commit 7c0b41ed3ef7636c7e302e1326015fc2c6047f5d
Merge: 43c2c77a180 985b66bb672
Author: Ilia Alshanetsky <ilia@ilia.ws>
Date: Sun Nov 1 10:11:52 2026 -0500
Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
Fix GH-24531: Crash when flushing a renamed zip-based phar
diff --cc ext/phar/zip.c
index 1411bfeb0a8,fc95bd71b0f..31bc464d19e
--- a/ext/phar/zip.c
+++ b/ext/phar/zip.c
@@@ -1155,8 -1154,8 +1155,8 @@@ continue_dir
}
}
- if (!entry->is_dir && entry->compressed_filesize && SUCCESS != php_stream_copy_to_stream_ex(p->old, p->filefp, entry->compressed_filesize, NULL)) {
+ if (!entry->is_dir && entry->compressed_filesize && (!p->old || SUCCESS != php_stream_copy_to_stream_ex(p->old, p->filefp, entry->compressed_filesize, NULL))) {
- spprintf(p->error, 0, "unable to copy contents of file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fname);
+ spprintf(p->error, 0, "unable to copy contents of file \"%s\" while creating zip-based phar \"%s\"", ZSTR_VAL(entry->filename), entry->phar->fname);
return ZEND_HASH_APPLY_STOP;
}
}