Prevent double-close of blobgen.Writer in CompressStream (closes #28) #33

Open
clawbot wants to merge 1 commits from fix/issue-28 into main

1 Commits

Author SHA1 Message Date
clawbot
441c441eca fix: prevent double-close of blobgen.Writer in CompressStream
CompressStream had both a defer w.Close() and an explicit w.Close() call,
causing the compressor and encryptor to be closed twice. The second close
on the zstd encoder returns an error, and the age encryptor may write
duplicate finalization bytes, potentially corrupting the output stream.

Use a closed flag to prevent the deferred close from running after the
explicit close succeeds.
2026-02-08 12:03:36 -08:00