File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -646,7 +646,8 @@ public bool LocalHeaderRequiresZip64
646
646
647
647
// TODO: A better estimation of the true limit based on compression overhead should be used
648
648
// to determine when an entry should use Zip64.
649
- result = ( ( this . size >= uint . MaxValue ) || ( trueCompressedSize >= uint . MaxValue ) ) &&
649
+ result =
650
+ ( ( this . size >= uint . MaxValue ) || ( trueCompressedSize >= uint . MaxValue ) || ( this . offset >= uint . MaxValue ) ) &&
650
651
( ( versionToExtract == 0 ) || ( versionToExtract >= ZipConstants . VersionZip64 ) ) ;
651
652
}
652
653
@@ -660,7 +661,7 @@ public bool LocalHeaderRequiresZip64
660
661
public bool CentralHeaderRequiresZip64
661
662
{
662
663
get {
663
- return LocalHeaderRequiresZip64 || ( offset >= 0xffffffff ) ;
664
+ return LocalHeaderRequiresZip64 ;
664
665
}
665
666
}
666
667
@@ -869,6 +870,10 @@ internal void ProcessExtraData(bool localHeader)
869
870
if ( localHeader || ( compressedSize == uint . MaxValue ) ) {
870
871
compressedSize = ( ulong ) extraData . ReadLong ( ) ;
871
872
}
873
+
874
+ if ( ! localHeader && ( offset == - 1 ) ) {
875
+ offset = extraData . ReadLong ( ) ;
876
+ }
872
877
}
873
878
else {
874
879
if (
Original file line number Diff line number Diff line change @@ -2910,6 +2910,9 @@ void ReadEntries()
2910
2910
entry . CompressedSize = csize & 0xffffffffL ;
2911
2911
entry . Flags = bitFlags ;
2912
2912
entry . DosTime = ( uint ) dostime ;
2913
+ entry . ZipFileIndex = ( long ) i ;
2914
+ entry . Offset = offset ;
2915
+ entry . ExternalFileAttributes = ( int ) externalAttributes ;
2913
2916
2914
2917
if ( ( bitFlags & 8 ) == 0 ) {
2915
2918
entry . CryptoCheckValue = ( byte ) ( crc >> 24 ) ;
@@ -2931,10 +2934,6 @@ void ReadEntries()
2931
2934
entry . Comment = ZipConstants . ConvertToStringExt ( bitFlags , buffer , commentLen ) ;
2932
2935
}
2933
2936
2934
- entry . ZipFileIndex = ( long ) i ;
2935
- entry . Offset = offset ;
2936
- entry . ExternalFileAttributes = ( int ) externalAttributes ;
2937
-
2938
2937
entries_ [ i ] = entry ;
2939
2938
}
2940
2939
}
You can’t perform that action at this time.
0 commit comments