From 585fba50b00b5716bbde7a1b05cbab114af8cdb0 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 7 Nov 2015 12:53:03 +0100 Subject: Adding upstream version 1.18~pre2. Signed-off-by: Daniel Baumann --- file_index.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'file_index.cc') diff --git a/file_index.cc b/file_index.cc index a1a0f30..af55417 100644 --- a/file_index.cc +++ b/file_index.cc @@ -86,7 +86,7 @@ File_index::File_index( const int infd ) if( member_size < min_member_size || member_size > pos ) { if( member_vector.empty() ) - { --pos; continue; } // maybe trailing garbage + { --pos; continue; } // maybe trailing data set_num_error( "Member size in trailer is corrupt at pos ", pos - 8 ); break; } @@ -96,10 +96,11 @@ File_index::File_index( const int infd ) if( !header.verify_magic() || !header.verify_version() ) { if( member_vector.empty() ) - { --pos; continue; } // maybe trailing garbage + { --pos; continue; } // maybe trailing data set_num_error( "Bad header at pos ", pos - member_size ); break; } + const unsigned dictionary_size = header.dictionary_size(); if( member_vector.empty() && isize - pos > File_header::size && seek_read( infd, header.data, File_header::size, pos ) == File_header::size && header.verify_magic() && header.verify_version() ) @@ -109,7 +110,7 @@ File_index::File_index( const int infd ) } pos -= member_size; member_vector.push_back( Member( 0, trailer.data_size(), - pos, member_size ) ); + pos, member_size, dictionary_size ) ); } if( pos != 0 || member_vector.empty() ) { @@ -184,7 +185,7 @@ File_index::File_index( const std::vector< int > & infd_vector, } if( !done ) { - if( member_vector.empty() ) // maybe trailing garbage + if( member_vector.empty() ) // maybe trailing data { --pos; continue; } set_num_error( "Member size in trailer may be corrupt at pos ", pos - 8 ); break; @@ -202,7 +203,7 @@ File_index::File_index( const std::vector< int > & infd_vector, } pos -= member_size; member_vector.push_back( Member( 0, trailer.data_size(), - pos, member_size ) ); + pos, member_size, 0 ) ); } error: if( pos != 0 || member_vector.empty() ) -- cgit v1.2.3