@@ -2546,7 +2546,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
2546
2546
php_stream_filter * filter ;
2547
2547
php_serialize_data_t metadata_hash ;
2548
2548
smart_str main_metadata_str = {0 };
2549
- int free_user_stub , free_fp = 1 , free_ufp = 1 ;
2549
+ int free_fp = 1 , free_ufp = 1 ;
2550
2550
int manifest_hack = 0 ;
2551
2551
php_stream * shared_cfp = NULL ;
2552
2552
@@ -2600,6 +2600,8 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
2600
2600
2601
2601
if (user_stub ) {
2602
2602
zend_string * suser_stub ;
2603
+ bool free_user_stub = false;
2604
+
2603
2605
if (len < 0 ) {
2604
2606
/* resource passed in */
2605
2607
if (!(php_stream_from_zval_no_verify (stubfile , (zval * )user_stub ))) {
@@ -2629,12 +2631,11 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
2629
2631
}
2630
2632
return EOF ;
2631
2633
}
2632
- free_user_stub = 1 ;
2634
+ free_user_stub = true ;
2633
2635
user_stub = ZSTR_VAL (suser_stub );
2634
2636
len = ZSTR_LEN (suser_stub );
2635
- } else {
2636
- free_user_stub = 0 ;
2637
2637
}
2638
+
2638
2639
if ((pos = php_stristr (user_stub , halt_stub , len , sizeof (halt_stub ) - 1 )) == NULL ) {
2639
2640
if (closeoldfile ) {
2640
2641
php_stream_close (oldfile );
@@ -3513,8 +3514,6 @@ void phar_request_initialize(void) /* {{{ */
3513
3514
3514
3515
PHP_RSHUTDOWN_FUNCTION (phar ) /* {{{ */
3515
3516
{
3516
- uint32_t i ;
3517
-
3518
3517
PHAR_G (request_ends ) = 1 ;
3519
3518
3520
3519
if (PHAR_G (request_init ))
@@ -3529,7 +3528,7 @@ PHP_RSHUTDOWN_FUNCTION(phar) /* {{{ */
3529
3528
PHAR_G (phar_SERVER_mung_list ) = 0 ;
3530
3529
3531
3530
if (PHAR_G (cached_fp )) {
3532
- for (i = 0 ; i < zend_hash_num_elements (& cached_phars ); ++ i ) {
3531
+ for (uint32_t i = 0 ; i < zend_hash_num_elements (& cached_phars ); ++ i ) {
3533
3532
if (PHAR_G (cached_fp )[i ].fp ) {
3534
3533
php_stream_close (PHAR_G (cached_fp )[i ].fp );
3535
3534
}
0 commit comments