From: Joseph Sutton Date: Mon, 7 Mar 2022 07:09:40 +0000 (+1300) Subject: compression: Use correct value for nibble_index X-Git-Tag: talloc-2.3.4~175 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7fab9f90e8a90318b279b1d69656fd997a597665;p=thirdparty%2Fsamba.git compression: Use correct value for nibble_index Previously, we were setting this to the wrong value and overwriting existing output data. Signed-off-by: Joseph Sutton Reviewed-by: Douglas Bagnall --- diff --git a/lib/compression/lzxpress.c b/lib/compression/lzxpress.c index b38e57fa2ae..0ecb6e23f93 100644 --- a/lib/compression/lzxpress.c +++ b/lib/compression/lzxpress.c @@ -151,10 +151,10 @@ ssize_t lzxpress_compress(const uint8_t *uncompressed, match_len -= 7; if (!nibble_index) { - nibble_index = compressed_pos; + nibble_index = compressed_pos + metadata_size; __CHECK_BYTES(max_compressed_size, compressed_pos + metadata_size, sizeof(uint8_t)); - compressed[compressed_pos + metadata_size] = MIN(match_len, 15); + compressed[nibble_index] = MIN(match_len, 15); metadata_size += sizeof(uint8_t); } else { __CHECK_BYTES(max_compressed_size, nibble_index, sizeof(uint8_t)); diff --git a/selftest/knownfail.d/lzxpress b/selftest/knownfail.d/lzxpress index 3d75b222212..0fe7fdba6e0 100644 --- a/selftest/knownfail.d/lzxpress +++ b/selftest/knownfail.d/lzxpress @@ -1,3 +1,2 @@ -samba4.local.compression.lzxpress4 samba4.local.compression.lzxpress5 samba4.local.compression.lzxpress6