compression: Fix writing output flags
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Mon, 7 Mar 2022 23:02:13 +0000 (12:02 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 12 May 2022 02:22:35 +0000 (02:22 +0000)
commit430bcd7a083a2dfbd12361f1ad352bc33e7963cb
tree5eba2b32096c4eab5cf75df62f2708daff6014bd
parentbb9115e023bb304e19aac074294694170c31dc51
compression: Fix writing output flags

If indic_bit == 0, the shift amount of 32 - indic_bit == 32 will equal
the width of a 32-bit integer type, and these shifts will invoke
undefined behaviour, which is likely to cause incorrect output. Fix this
by not shifting a 32-bit integer type by 32 bits or more.

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 [deleted file]