mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1: Fix incorrect check in phar tar parsing
This commit is contained in:
commit
08f654b590
2 changed files with 6 additions and 2 deletions
3
NEWS
3
NEWS
|
@ -21,6 +21,9 @@ PHP NEWS
|
|||
- Opcache:
|
||||
. Fix incorrect page_size check. (nielsdos)
|
||||
|
||||
- Phar:
|
||||
. Fix incorrect check in phar tar parsing. (nielsdos)
|
||||
|
||||
- Random:
|
||||
. Fix GH-10390 (Do not trust arc4random_buf() on glibc). (timwolla)
|
||||
. Fix GH-10292 (Made the default value of the first param of srand() and
|
||||
|
|
|
@ -478,14 +478,15 @@ bail:
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue