[PATCH] erofs-utils: lib: return error on ZSTD decompression length mismatch

Gao Xiang hsiangkao at linux.alibaba.com
Thu Mar 19 21:18:53 AEDT 2026



On 2026/3/19 18:17, Utkal Singh wrote:
> When ZSTD_decompress() returns a size different from the expected
> decoded size, the current code logs an error and jumps to cleanup
> without setting ret to a negative value.
> 
> Since ret still holds a positive byte count, the caller interprets
> it as success, potentially treating incorrectly decompressed data
> as valid output.
> 
> Set ret to -EIO before jumping to cleanup, consistent with the
> existing ZSTD_isError() handling above.
> 
> Signed-off-by: Utkal Singh <singhutkal015 at gmail.com>

Please stop resending the patch without any modification.


More information about the Linux-erofs mailing list