From 846a2375c1e9c4a4e3ac38dbb72f4e8723c3799c Mon Sep 17 00:00:00 2001 From: Vinit Agnihotri Date: Fri, 8 Aug 2025 17:53:14 +0530 Subject: [PATCH] compression/tests: Fix possible out of bound access CID:1517301 This would fix additional coverity issue:1517285 Signed-off-by: Vinit Agnihotri Reviewed-by: Douglas Bagnall Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Mon Aug 11 22:59:26 UTC 2025 on atb-devel-224 --- lib/compression/tests/test_lzxpress_plain.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/compression/tests/test_lzxpress_plain.c b/lib/compression/tests/test_lzxpress_plain.c index 1c147932d40..44b8f908511 100644 --- a/lib/compression/tests/test_lzxpress_plain.c +++ b/lib/compression/tests/test_lzxpress_plain.c @@ -363,6 +363,11 @@ static ssize_t attempt_round_trip(TALLOC_CTX *mem_ctx, comp_written, decompressed.data, decompressed.length); + if (decomp_written <= 0) { + talloc_free(tmp_ctx); + return -1; + } + debug_end_timer("decompress", original.length); if (save_name != NULL && LZX_DEBUG_FILES) { char s[300]; -- 2.47.3