Fix failing fuzzer if compiling with ubsan

See patch #10163

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
This commit is contained in:
Wouter van Gulik 2021-12-22 11:41:00 +01:00 committed by Simon Goldschmidt
parent 7e96691ccf
commit 5ab46f82f9

View File

@ -688,8 +688,8 @@ u32_t lwip_fuzz_rand(void)
/* a simple LCG, unsafe but should give the same result for every execution (best for fuzzing) */
u32_t result;
static s32_t state[1] = {0xdeadbeef};
s32_t val = state[0];
val = ((state[0] * 1103515245) + 12345) & 0x7fffffff;
uint64_t val = state[0] & 0xffffffff;
val = ((val * 1103515245) + 12345) & 0x7fffffff;
state[0] = val;
result = val;
return result;