1
0
Fork 0

Merging upstream version 0.26.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-17 21:27:57 +01:00
parent 7185f44b62
commit 180f99b04d
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
44 changed files with 610 additions and 505 deletions

View file

@ -19,7 +19,7 @@
#include <algorithm>
#include <cerrno>
#include <stdint.h> // for lzlib.h
#include <stdint.h> // for lzlib.h
#include <unistd.h>
#include <lzlib.h>
@ -116,12 +116,12 @@ int Archive_reader::read( uint8_t * const buf, const int size )
const int rd = readblock( ad.infd, buf, size );
if( rd != size && errno ) return err( -1, rdaerr_msg, errno, rd );
const Lzip_header & header = (*(const Lzip_header *)buf);
const bool islz = ( rd >= min_member_size && header.check_magic() &&
header.check_version() &&
isvalid_ds( header.dictionary_size() ) );
const bool istar = ( rd == size && check_ustar_chksum( buf ) );
const bool islz = rd >= min_member_size && header.check_magic() &&
header.check_version() &&
isvalid_ds( header.dictionary_size() );
const bool istar = rd == size && check_ustar_chksum( buf );
const bool iseoa =
( !islz && !istar && rd == size && block_is_zero( buf, size ) );
!islz && !istar && rd == size && block_is_zero( buf, size );
bool maybe_lz = islz; // maybe corrupt tar.lz
if( !islz && !istar && !iseoa ) // corrupt or invalid format
{
@ -165,7 +165,7 @@ int Archive_reader::read( uint8_t * const buf, const int size )
if( new_pos >= old_pos && new_pos < LLONG_MAX )
return err( 2, "", 0, sz, true );
return err( -1, "Skipping to next header failed. "
"Lzlib 1.8 or newer required.", 0, sz );
"Lzlib 1.8 or newer required.", 0, sz );
}
if( rd == 0 && LZ_decompress_finished( decoder ) == 1 )
{ return err( -2, end_msg, 0, sz ); }