Skip to content

Commit

Permalink
[XrdCl] ZipArchive: make sure to use the right cdSize/nbCdRec.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichal committed Jan 4, 2021
1 parent 22d308a commit 87196db
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/XrdCl/XrdClZipArchive.cc
Expand Up @@ -215,7 +215,10 @@ namespace XrdCl
std::copy( buff, buff + orgcdsz, std::back_inserter( orgcdbuf ) );
try
{
std::tie( cdvec, cdmap ) = CDFH::Parse( buff, eocd->cdSize, eocd->nbCdRec );
if( zip64eocd )
std::tie( cdvec, cdmap ) = CDFH::Parse( buff, zip64eocd->cdSize, zip64eocd->nbCdRec );
else
std::tie( cdvec, cdmap ) = CDFH::Parse( buff, eocd->cdSize, eocd->nbCdRec );
}
catch( const bad_data &ex )
{
Expand Down Expand Up @@ -313,6 +316,7 @@ namespace XrdCl

const char *buff = buffer.data();
size_t size = buffer.size();

// parse Central Directory records
std::tie(cdvec, cdmap ) = CDFH::Parse( buff, size );
// make a copy of the original CDFH records
Expand Down

0 comments on commit 87196db

Please sign in to comment.