doublecmd/plugins/wcx/zip/src
EH 6123a21ed0
FIX: Zip plugin - allow cancelling TAR archive packing mid-operation (#2874)
* FIX: zip plugin - allow cancelling TAR archive packing mid-operation

TAbTarArchive.SaveArchive iterated all items without ever checking
the abort flag, making it impossible to cancel a TAR/TGZ/TBZ2 pack
operation until all files had been written.

Add a DoArchiveProgress call with abort check after each item in the
save loop, identical to the pattern already used in TAbZipArchive.SaveArchive
(abziptyp.pas) and in all extract loops (abarctyp.pas).

When the user cancels, EAbUserAbort is raised, caught in PackFilesW,
and the incomplete archive is deleted if it did not exist before packing.

* FIX: zip plugin - prevent crash on TAR abort inside GZip archive

When TAbUserAbort propagates out of TAbTarArchive.SaveArchive (e.g.
from the abort check added to the save loop), it exits the IsGzippedTar
branch of TAbGzipArchive.SaveArchive without calling SwapToGzip. The
outer finally block then compares FStream (which equals FTarStream,
possibly nil) with NewStream (FGzStream) and incorrectly frees
NewStream. The destructor later calls SwapToGzip (restoring FStream to
the already-freed FGzStream) and then frees FStream a second time,
causing an access violation.

Fix: compare FGzStream instead of FStream in the finally condition.
FGzStream always holds the original gzip stream reference and is never
changed by SwapToTar/SwapToGzip, so the NewStream ownership check is
correct regardless of which swap state the archive is in.

---------

Co-authored-by: heredie <heredie@localhost>
2026-05-23 12:12:23 +03:00
..
fparchive FIX: Zip plugin - allow cancelling TAR archive packing mid-operation (#2874) 2026-05-23 12:12:23 +03:00
inflate64 FIX: Zip - Invalid pointer operation 2025-01-30 22:06:28 +03:00
lzma UPD: Relocate source code 2017-10-22 17:59:40 +00:00
Zip.dpr ADD: Zip - capability to change compression settings of all supported formats 2023-02-25 12:00:23 +03:00
Zip.lpi ADD: Zip - extract from brotli compressed files (.br) 2025-09-20 22:12:38 +03:00
ZipApp.pas FIX: Zip - When reading archives replace relative paths by underlines 2025-11-02 13:46:22 +03:00
ZipCache.pas ADD: Zip - save password to cache (issue #1254) 2023-09-09 14:55:04 +03:00
ZipConfDlg.lfm ADD: Zip - capability to change compression settings of all supported formats 2023-02-25 12:00:23 +03:00
ZipConfDlg.pas FIX: Change zip plugin configuration force quits (fixes #1233) 2023-09-09 13:34:21 +03:00
ZipFunc.pas FIX: CanYouHandleThisFile function result type 2026-03-16 16:23:12 +03:00
ZipLng.pas ADD: Zip - translate resource strings 2023-02-25 17:23:18 +03:00
ZipOpt.pas ADD: Zip - extract from brotli compressed files (.br) 2025-09-20 22:12:38 +03:00