paszlib, unable to extract with "out of range" error
Original Reporter info from Mantis: AlexVas
-
Reporter name: Alex Vasiliev
Original Reporter info from Mantis: AlexVas
- Reporter name: Alex Vasiliev
Description:
Failing to extract from an archive created by Maven/Java8 with "out of range" error. Other archivers have no problems extracting from it. The archive is attached.
Steps to reproduce:
procedure TestUnZipAll(const FileName, OutputPath: String);
var
UnZipper: TUnZipper;
begin
UnZipper := TUnZipper.Create;
try
UnZipper.FileName := FileName;
UnZipper.OutputPath := OutputPath;
UnZipper.Examine;
UnZipper.UnZipAllFiles;
finally
UnZipper.Free;
end;
end;
Additional information:
The range error happens on line 173 of packages/paszlib/src/infcodes.pas file:
{DUMPBITS(t^.bits);}
b := b shr t^.bits;
dec(k, t^.bits);
https://github.com/graemeg/freepascal/blob/master/packages/paszlib/src/infcodes.pas
If range error check is compiled out, then "Invalid CRC checksum while unzipping jre.oracle.win64-1.8.0_111a/bin/javafx_font_t2k.dll." is thrown.
Cheers.
Mantis conversion info:
- Mantis ID: 31219
- Version: 1.6.3 (SVN)
- Fixed in version: 3.1.1
- Fixed in revision: 38657 (#df435ca1)
- Monitored by: » AlexVas (Alex Vasiliev)
- Target version: 3.2.0