diff options
Diffstat (limited to 'file_index.cc')
-rw-r--r-- | file_index.cc | 11 |
1 files changed, 6 insertions, 5 deletions
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() ) |