1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

phar: Avoid an error goto in phar_zip_flush() (#20233)

This commit is contained in:
Niels Dossche
2025-10-20 20:34:04 +02:00
committed by GitHub
parent a69b35328d
commit 9c90e16e18

View File

@@ -1392,8 +1392,8 @@ fperror:
zend_hash_apply_with_argument(&phar->manifest, phar_zip_changed_apply, (void *) &pass);
phar_metadata_tracker_try_ensure_has_serialized_data(&phar->metadata_tracker, phar->is_persistent);
if (pass_error) {
has_pass_error:
if (pass_error
|| FAILURE == phar_zip_applysignature(phar, &pass)) {
spprintf(error, 4096, "phar zip flush of \"%s\" failed: %s", phar->fname, pass_error);
efree(pass_error);
nopasserror:
@@ -1406,11 +1406,6 @@ nocentralerror:
return;
}
if (FAILURE == phar_zip_applysignature(phar, &pass)) {
ZEND_ASSERT(pass_error != NULL);
goto has_pass_error;
}
/* save zip */
cdir_size = php_stream_tell(pass.centralfp);
cdir_offset = php_stream_tell(pass.filefp);