From: Vinit Agnihotri Date: Fri, 8 Aug 2025 12:23:14 +0000 (+0530) Subject: compression/tests: Fix possible out of bound access CID:1517301 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=HEAD;p=thirdparty%2Fsamba.git 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 --- 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];