From e36cb10b1629c1bf8d8c365c02bbe1e81cd75548 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Wed, 11 May 2022 16:06:38 +1200 Subject: [PATCH] compression: lzxpress decompress empty string as empty string This mirrors the behaviour of lzxpress_compress, which "encodes" an empty string as an empty string. Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- lib/compression/lzxpress.c | 4 ++++ selftest/knownfail.d/lzexpress | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) delete mode 100644 selftest/knownfail.d/lzexpress diff --git a/lib/compression/lzxpress.c b/lib/compression/lzxpress.c index 288fa0bcba8..f7da9b817f9 100644 --- a/lib/compression/lzxpress.c +++ b/lib/compression/lzxpress.c @@ -218,6 +218,10 @@ ssize_t lzxpress_decompress(const uint8_t *input, uint32_t indicator, indicator_bit; uint32_t nibble_index; + if (input_size == 0) { + return 0; + } + output_index = 0; input_index = 0; indicator = 0; diff --git a/selftest/knownfail.d/lzexpress b/selftest/knownfail.d/lzexpress deleted file mode 100644 index a7dafdbaa33..00000000000 --- a/selftest/knownfail.d/lzexpress +++ /dev/null @@ -1 +0,0 @@ -samba4.local.compression.lzxpress_round_trip