mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3: Fix GH-16406: Assertion failure in ext/phar/phar.c:2808
This commit is contained in:
commit
d8e516631f
3 changed files with 41 additions and 0 deletions
3
NEWS
3
NEWS
|
@ -65,6 +65,9 @@ PHP NEWS
|
||||||
. Fixed bug GH-16433 (Large values for openssl_csr_sign() $days overflow).
|
. Fixed bug GH-16433 (Large values for openssl_csr_sign() $days overflow).
|
||||||
(cmb)
|
(cmb)
|
||||||
|
|
||||||
|
- Phar:
|
||||||
|
. Fixed bug GH-16406 (Assertion failure in ext/phar/phar.c:2808). (nielsdos)
|
||||||
|
|
||||||
- PHPDBG:
|
- PHPDBG:
|
||||||
. Fixed bug GH-16174 (Empty string is an invalid expression for ev). (cmb)
|
. Fixed bug GH-16174 (Empty string is an invalid expression for ev). (cmb)
|
||||||
|
|
||||||
|
|
|
@ -2308,6 +2308,9 @@ no_copy:
|
||||||
newentry.tar_type = (entry->is_dir ? TAR_DIR : TAR_FILE);
|
newentry.tar_type = (entry->is_dir ? TAR_DIR : TAR_FILE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* The header offset is only used for unmodified zips.
|
||||||
|
* Once modified, phar_zip_changed_apply_int() will update the header_offset. */
|
||||||
|
newentry.header_offset = 0;
|
||||||
newentry.is_modified = 1;
|
newentry.is_modified = 1;
|
||||||
newentry.phar = phar;
|
newentry.phar = phar;
|
||||||
newentry.old_flags = newentry.flags & ~PHAR_ENT_COMPRESSION_MASK; /* remove compression from old_flags */
|
newentry.old_flags = newentry.flags & ~PHAR_ENT_COMPRESSION_MASK; /* remove compression from old_flags */
|
||||||
|
|
35
ext/phar/tests/gh16406.phpt
Normal file
35
ext/phar/tests/gh16406.phpt
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
--TEST--
|
||||||
|
GH-16406 (Assertion failure in ext/phar/phar.c:2808)
|
||||||
|
--EXTENSIONS--
|
||||||
|
phar
|
||||||
|
zlib
|
||||||
|
--INI--
|
||||||
|
phar.readonly=0
|
||||||
|
phar.require_hash=0
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
$fname = __DIR__ . '/gh16406.phar';
|
||||||
|
@unlink($fname . '.tar');
|
||||||
|
@unlink($fname . '.gz');
|
||||||
|
@unlink($fname);
|
||||||
|
$file = '<?php __HALT_COMPILER(); ?>';
|
||||||
|
$files['b'] = 'b';
|
||||||
|
$files['c'] = 'c';
|
||||||
|
include __DIR__.'/files/phar_test.inc';
|
||||||
|
$phar = new Phar($fname);
|
||||||
|
$phar->compressFiles(Phar::GZ);
|
||||||
|
$phar = $phar->convertToExecutable(Phar::TAR);
|
||||||
|
$phar = $phar->convertToExecutable(Phar::PHAR, Phar::GZ);
|
||||||
|
var_dump($phar['b']->openFile()->fread(4096));
|
||||||
|
var_dump($phar['c']->openFile()->fread(4096));
|
||||||
|
?>
|
||||||
|
--CLEAN--
|
||||||
|
<?php
|
||||||
|
$fname = __DIR__ . '/gh16406.phar';
|
||||||
|
@unlink($fname . '.tar');
|
||||||
|
@unlink($fname . '.gz');
|
||||||
|
@unlink($fname);
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
string(1) "b"
|
||||||
|
string(1) "c"
|
Loading…
Add table
Add a link
Reference in a new issue