Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in ZMUnzipOpr.pas #2

Open
raelb opened this issue Jun 5, 2023 · 0 comments
Open

Bug in ZMUnzipOpr.pas #2

raelb opened this issue Jun 5, 2023 · 0 comments

Comments

@raelb
Copy link

raelb commented Jun 5, 2023

Hi Edwin,
From my analysis, there appears to be a bug in ZMUnzipOpr.pas.

function TZMUnzipOpr.UnzipAStream

Needs to include a call to ZReader.File_Close (at end of method)

  if Result >= 0 then
  begin
    ZReader.Guage.NewItem(ZName, ZRec.CompressedSize);
    try
      Result := FExtractor.Decompress;
      Body.TraceFmt('Inflate returns: %s', [Body.Errors.ErrorStr(Result)],
        {_LINE_}1315, __UNIT__);
      if Result >= 0 then
        Result := CheckCRC(FExtractor.CRC, ZRec.CRC32, ZRec.FileName);
      Err := AbsErr(Result);
      if (DestStream <> nil) and ((Err = ZE_BadCRC) or (Err = ZE_EntryCancelled))
      then
        DestStream.Size := 0;
    finally
      ZReader.Guage.EndItem;

      ZReader.File_Close; // -> Added
    end;
  end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant