Skip to content

Commit 846a237

Browse files
Vinit AgnihotriMartin Schwenke
authored andcommitted
compression/tests: Fix possible out of bound access CID:1517301
This would fix additional coverity issue:1517285 Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Mon Aug 11 22:59:26 UTC 2025 on atb-devel-224
1 parent 713203b commit 846a237

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/compression/tests/test_lzxpress_plain.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,11 @@ static ssize_t attempt_round_trip(TALLOC_CTX *mem_ctx,
363363
comp_written,
364364
decompressed.data,
365365
decompressed.length);
366+
if (decomp_written <= 0) {
367+
talloc_free(tmp_ctx);
368+
return -1;
369+
}
370+
366371
debug_end_timer("decompress", original.length);
367372
if (save_name != NULL && LZX_DEBUG_FILES) {
368373
char s[300];

0 commit comments

Comments
 (0)