diff options
author | Frediano Ziglio <fziglio@redhat.com> | 2018-04-23 10:50:43 +0100 |
---|---|---|
committer | Frediano Ziglio <fziglio@redhat.com> | 2018-04-26 13:40:55 +0100 |
commit | 920b969a18b90ba929c6e7cd46eeab819be20883 (patch) | |
tree | b36bec1031311ad7161c2306ebf894451e728eba | |
parent | 8f4bfccb80f5b28e6a492d6e0c358335c3438d59 (diff) |
glz-encoder: Do not discard top bits of lower part sending 64 bit ints0.14
When GLZ code attempts to send a 64 bit integer the 8 top bit of
the lower (32 bits) part of the number are stripped due to a bug.
This was discovered by Zhongqiang Huang <useprxf@gmail.com>
Reported-by: Zhongqiang Huang <useprxf@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
-rw-r--r-- | server/glz-encoder.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/server/glz-encoder.c b/server/glz-encoder.c index c258726c..dba2cd12 100644 --- a/server/glz-encoder.c +++ b/server/glz-encoder.c @@ -84,7 +84,7 @@ static inline void encode_32(Encoder *encoder, unsigned int word) static inline void encode_64(Encoder *encoder, uint64_t word) { encode_32(encoder, (uint32_t)(word >> 32)); - encode_32(encoder, (uint32_t)(word & 0xffffff)); + encode_32(encoder, (uint32_t)(word & 0xffffffffu)); } static inline void encode_copy_count(Encoder *encoder, uint8_t copy_count) |