Commit 0f5866cf14b for php
commit 0f5866cf14b22e31f540b81a00a5a13e02d58e50
Merge: bbb21f0336a 7c0b41ed3ef
Author: Ilia Alshanetsky <ilia@ilia.ws>
Date: Sun Nov 1 10:12:13 2026 -0500
Merge branch 'PHP-8.5' into PHP-8.6
* PHP-8.5:
Fix GH-24531: Crash when flushing a renamed zip-based phar
diff --cc NEWS
index a9bb0d16f78,75256b65a31..d7dc0e39c3a
--- a/NEWS
+++ b/NEWS
@@@ -166,10 -235,23 +166,12 @@@ PH
are equal). (Lazizbek Ergashev)
. Fixed bug GH-25092 (Double free in Phar::copy() on link and
mounted entries). (Lazizbek Ergashev)
+ . Fixed bug GH-24531 (Crash when modifying a zip-based phar whose file was
+ renamed). (Ilia Alshanetsky)
-- Phpdbg:
- . Fix wrong command names. (ndossche, Weilin Du)
- . Fixed bug GH-22480 (Use-after-free when re-watching an already-watched
- variable). (Ilia Alshanetsky)
- . Fixed over-read when watching a packed array element. (Ilia Alshanetsky)
- . Fixed double free of watch element chains. (Arnaud)
-
-- POSIX:
- . Fixed posix_setrlimit() rejecting POSIX_RLIMIT_INFINITY on Solaris.
- (Jorg Sowa)
-
-- Readline:
- . Fixed a crash in readline_info() when completion_append_character
- contains a non-ASCII byte. (Weilin Du)
+- Reflection:
+ . Fixed bug GH-21768 (Assertion failure in ReflectionProperty::isReadable()
+ and isWritable() on internal virtual properties). (David Carlier)
- SAPI:
. Fixed infinite loop in sapi_header_op() for headers of 4 GiB or more.
diff --cc ext/phar/zip.c
index b1cfd897fa6,31bc464d19e..13c34d8a3b0
--- a/ext/phar/zip.c
+++ b/ext/phar/zip.c
@@@ -1152,8 -1155,8 +1152,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\"", ZSTR_VAL(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), ZSTR_VAL(entry->phar->fname));
return ZEND_HASH_APPLY_STOP;
}
}