compression: Use correct value for indic_pos
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Mon, 7 Mar 2022 07:09:40 +0000 (20:09 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 12 May 2022 02:22:35 +0000 (02:22 +0000)
Previously, we were setting this to the wrong value and overwriting
existing output data.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
lib/compression/lzxpress.c
selftest/knownfail.d/lzxpress

index 0ecb6e23f931874ed3e285e49f497bdb865b6fd5..d3195a49435d932a2b32f2c34c8517c3f3110af2 100644 (file)
@@ -201,8 +201,8 @@ ssize_t lzxpress_compress(const uint8_t *uncompressed,
                        if (indic_bit == 32) {
                                PUSH_LE_U32(indic_pos, 0, indic);
                                indic_bit = 0;
-                               indic_pos = &compressed[compressed_pos];
-                               compressed_pos += sizeof(uint32_t);
+                               indic_pos = &compressed[compressed_pos + metadata_size];
+                               metadata_size += sizeof(uint32_t);
                        }
 
                        compressed_pos += metadata_size;
index 0fe7fdba6e0272e3cd9fe7061ab06ec1ba13fa51..922401eaa035ec843c4791f9fb52ca36e4457a2a 100644 (file)
@@ -1,2 +1 @@
-samba4.local.compression.lzxpress5
 samba4.local.compression.lzxpress6