> After re-reading the LZ4 and GZIP code, I agree ?? the parameter is indeed 
> wrong.
> It looks like decompressor_finalize has the same issue in both 
> implementations.
> Would you mind taking a look?
> 
> diff --git a/src/fe_utils/astreamer_gzip.c b/src/fe_utils/astreamer_gzip.c
> index e8d62f754ca..4ccec1a5a7f 100644
> --- a/src/fe_utils/astreamer_gzip.c
> +++ b/src/fe_utils/astreamer_gzip.c
> @@ -349,7 +349,7 @@ astreamer_gzip_decompressor_finalize(astreamer *streamer)
> */
> astreamer_content(mystreamer->base.bbs_next, NULL,
>   mystreamer->base.bbs_buffer.data,
> -   mystreamer->base.bbs_buffer.maxlen,
> +   mystreamer->bytes_written,
>   ASTREAMER_UNKNOWN);
> 
> astreamer_finalize(mystreamer->base.bbs_next);
> diff --git a/src/fe_utils/astreamer_lz4.c b/src/fe_utils/astreamer_lz4.c
> index bcee7e088de..570e5305874 100644
> --- a/src/fe_utils/astreamer_lz4.c
> +++ b/src/fe_utils/astreamer_lz4.c
> @@ -401,7 +401,7 @@ astreamer_lz4_decompressor_finalize(astreamer *streamer)
> */
> astreamer_content(mystreamer->base.bbs_next, NULL,
>   mystreamer->base.bbs_buffer.data,
> -   mystreamer->base.bbs_buffer.maxlen,
> +   mystreamer->bytes_written,
>   ASTREAMER_UNKNOWN);
> 
> astreamer_finalize(mystreamer->base.bbs_next);

Hi,

Thank you for your review. I've moved it to 0003, and the test passed without 
any issues.
However, I'm wondering why no one else reported this. Perhaps this part isn't 
actually worth changing.
I think we can invite Mr. Robert Haas to help me confirm this, so I've chosen 
to CC him.

--
Regards,
Man Zeng
www.openhalo.org

Attachment: 0001-Fix-comment-error-in-astreamer_zstd.c-header.patch
Description: Binary data

Attachment: 0002-Fix-data-corruption-in-astreamer_zstd_decompressor_f.patch
Description: Binary data

Attachment: 0003-Fix-output-buffer-handling-in-astreamer_gzip-and-ast.patch
Description: Binary data

Reply via email to