Skip to content

Commit

Permalink
[XrdEc] Small bugfixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichal committed Jan 4, 2021
1 parent 87196db commit 8724e20
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/XrdCl/XrdClZipArchive.cc
Expand Up @@ -287,7 +287,6 @@ namespace XrdCl
size += eocd->eocdSize ;
size += eocd->cdSize;
// then create zip64eocd & zip64eocdl if necessary
std::unique_ptr<ZIP64_EOCD> zip64eocd;
std::unique_ptr<ZIP64_EOCDL> zip64eocdl;
if( eocd->useZip64 )
{
Expand Down
3 changes: 2 additions & 1 deletion src/XrdEc/XrdEcReader.hh
Expand Up @@ -305,7 +305,8 @@ namespace XrdEc
delete[] buffer;
}
// close the file if necessary (we don't really care about the result)
if( file->IsOpen() ) file->Close( nullptr );
if( file->IsOpen() )
XrdCl::Async( XrdCl::Close( *file ) >> [file]( XrdCl::XRootDStatus& ){ } );
} );
}

Expand Down
5 changes: 3 additions & 2 deletions src/XrdZip/XrdZipCDFH.hh
Expand Up @@ -106,10 +106,11 @@ namespace XrdZip
size_t i = 0;
while( bufferSize > 0 )
{
if( bufferSize < cdfhBaseSize ) throw bad_data();
if( bufferSize < sizeof( uint32_t ) ) throw bad_data();
// check the signature
uint32_t signature = to<uint32_t>( buffer );
if( signature != cdfhSign ) throw bad_data();
if( signature != cdfhSign )
return std::make_tuple( std::move( cdvec ), std::move( cdmap ) );
// parse the record
std::unique_ptr<CDFH> cdfh( new CDFH( buffer ) );
if( bufferSize < cdfh->cdfhSize ) throw bad_data();
Expand Down

0 comments on commit 8724e20

Please sign in to comment.