> On 10 Aug 2026, at 10:11, Chao Li <[email protected]> wrote:
>> On Aug 10, 2026, at 14:45, Chao Li <[email protected]> wrote:

>> See attached 0002 for the fix of gzip streamer. I will check the lz4 
>> streamer next.
> 
> Confirmed that lz4 also has the same problem. See the similar repro script:

Thanks for this patchset, I think this is something we should fix.  I took the
liberty to squash the patchset into a single patch to start preparing it for
the final shape, as well as adding a testcase to verify this.

+       /* Reject empty input, which does not contain a complete zstd frame. */
+       streamer->decompression_ret = 1;

I am not a huge fan of this, we claim that we save the return value but then we
assign a value which hasn't yet been returned as a sentinel.  Given that the
return is a size_t we also can't really invent a sentinel.  Since we don't
actually use the returned value for anything but "done or not-done", so I
propose something like the attached which interprets the value and stores a
named state. What are your thoughts on this?

--
Daniel Gustafsson

Attachment: v4-0001-Fix-detection-of-truncated-compressed-backups.patch
Description: Binary data

Reply via email to