]> git.ipfire.org Git - thirdparty/hostap.git/commit
UBSan: Define FST LLT macros without integer overflow
authorJouni Malinen <j@w1.fi>
Sat, 23 Feb 2019 15:39:38 +0000 (17:39 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 25 Feb 2019 17:48:49 +0000 (19:48 +0200)
commitcce974d367d41271a26451d663593f6c490aa2b9
treed58a42516894b4264a32206fcaae30bf3b589d3f
parent9140caf5fbe8a035f09c83b78126169dabdb1d38
UBSan: Define FST LLT macros without integer overflow

FST_MAX_LLT_MS definition depended on undefined behavior with unsigned
integer overflow. Avoid that and also optimize the
FST_LLT_{MS_TO_VAL,VAL_TO_MS} macros to handle larger values without
overflowing 32-bit unsigned integers.

fst_session.c:1274:52: runtime error: unsigned integer overflow: 4294967295 * 32 cannot be represented in type 'unsigned int'

Signed-off-by: Jouni Malinen <j@w1.fi>
src/fst/fst.h