[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-cvs
Subject:    [PHP-CVS] [php-src] master: Merge branch 'PHP-8.2'
From:       George Peter Banyard <noreply () php ! net>
Date:       2023-01-29 17:30:40
Message-ID: vBz5w8zqBcyEAmeuxxBQpMqXnJQsu1wk1xrbv9ATrY () main ! php ! net
[Download RAW message or body]

Author: George Peter Banyard (Girgias)
Date: 2023-01-29T17:17:32Z

Commit: https://github.com/php/php-src/commit/231ffaf394b2a2ee1c4c823eb488d70373da4b1e
Raw diff: https://github.com/php/php-src/commit/231ffaf394b2a2ee1c4c823eb488d70373da4b1e.diff

Merge branch 'PHP-8.2'

* PHP-8.2:
  Fix incorrect check in phar tar parsing

Changed paths:
  M  ext/phar/tar.c


Diff:

diff --git a/ext/phar/tar.c b/ext/phar/tar.c
index 3b2e4c2ca76a..1edc00834499 100644
--- a/ext/phar/tar.c
+++ b/ext/phar/tar.c
@@ -478,14 +478,15 @@ int phar_parse_tarfile(php_stream* fp, char *fname, size_t fname_len, char *alia
 			return FAILURE;
 		}
 
+		uint32_t entry_mode = phar_tar_number(hdr->mode, sizeof(hdr->mode));
 		entry.tar_type = ((old & (hdr->typeflag == '\0')) ? TAR_FILE : hdr->typeflag);
 		entry.offset = entry.offset_abs = pos; /* header_offset unused in tar */
 		entry.fp_type = PHAR_FP;
-		entry.flags = phar_tar_number(hdr->mode, sizeof(hdr->mode)) & PHAR_ENT_PERM_MASK;
+		entry.flags = entry_mode & PHAR_ENT_PERM_MASK;
 		entry.timestamp = phar_tar_number(hdr->mtime, sizeof(hdr->mtime));
 		entry.is_persistent = myphar->is_persistent;
 
-		if (old && entry.tar_type == TAR_FILE && S_ISDIR(entry.flags)) {
+		if (old && entry.tar_type == TAR_FILE && S_ISDIR(entry_mode)) {
 			entry.tar_type = TAR_DIR;
 		}
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic