Integer promotion converts u8 rsnxe[i] to an int which is not
sufficiently large to be able to handle the maximum shift left of 24
bits here. Type cast rsnxe[i] to u32 explicitly to get rid of the sign
bit and avoid this undefined behavior from the shift operation.
Credit to OSS-Fuzz: https://issues.oss-fuzz.com/issues/
376786400
Fixes: d675d3b15b40 ("Add helper functions for parsing RSNXE capabilities")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
if (flen > 4)
flen = 4;
for (i = 0; i < flen; i++)
- capabs |= rsnxe[i] << (8 * i);
+ capabs |= (u32) rsnxe[i] << (8 * i);
return !!(capabs & BIT(capab));
}