diff options
author | Andreas Schneider <asn@samba.org> | 2018-11-22 15:11:09 +0100 |
---|---|---|
committer | Gary Lockyer <gary@samba.org> | 2018-11-22 22:13:27 +0100 |
commit | aab5034a9ddc57ee9ce14ce584e53bd9b96b7a58 (patch) | |
tree | 37bb1341747c95c90257bbc26cce2bc053978dd8 /lib/compression/lzxpress.c | |
parent | 93ab0cef2a0f68788f77d8fce7e4f795e9921a9b (diff) | |
download | samba-aab5034a9ddc57ee9ce14ce584e53bd9b96b7a58.tar.gz |
lib:compression: Fix undefined behavior in lzxpress
lib/compression/lzxpress.c:228 runtime error: store to misaligned
address 0x5631d53ca9fe for type 'uint32_t', which requires 4 byte
alignment
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Diffstat (limited to 'lib/compression/lzxpress.c')
-rw-r--r-- | lib/compression/lzxpress.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/compression/lzxpress.c b/lib/compression/lzxpress.c index a4ded7e4555..024aba4c2ce 100644 --- a/lib/compression/lzxpress.c +++ b/lib/compression/lzxpress.c @@ -225,7 +225,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; + SIVAL(compressed, compressed_pos, 0); SIVAL(indic_pos, 0, indic); compressed_pos += sizeof(uint32_t); } |