compression: fixed an uninitialised data but in lzxpress
[sfrench/samba-autobuild/.git] / lib / compression / lzxpress.c
index 26b1bd5052df7e4a99a921f9979c9c54e8002961..0396c9ddcb2df3a3a250a464ef05ce43c64e9791 100644 (file)
@@ -80,6 +80,7 @@ ssize_t lzxpress_compress(const uint8_t *uncompressed,
 
        uncompressed_pos = 0;
        indic = 0;
+       *(uint32_t *)compressed = 0;
        compressed_pos = sizeof(uint32_t);
        indic_pos = &compressed[0];
 
@@ -223,6 +224,7 @@ ssize_t lzxpress_compress(const uint8_t *uncompressed,
                for (; (indic_bit % 32) != 0; indic_bit++)
                        indic |= 0 << (32 - ((indic_bit % 32) + 1));
 
+               *(uint32_t *)&compressed[compressed_pos] = 0;
                *(uint32_t *)indic_pos = indic;
                compressed_pos += sizeof(uint32_t);
        }