mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-07-04 20:08:57 +00:00
Fix failing fuzzer if compiling with ubsan
See patch #10163 Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
This commit is contained in:
parent
7e96691ccf
commit
5ab46f82f9
|
@ -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) */
|
/* a simple LCG, unsafe but should give the same result for every execution (best for fuzzing) */
|
||||||
u32_t result;
|
u32_t result;
|
||||||
static s32_t state[1] = {0xdeadbeef};
|
static s32_t state[1] = {0xdeadbeef};
|
||||||
s32_t val = state[0];
|
uint64_t val = state[0] & 0xffffffff;
|
||||||
val = ((state[0] * 1103515245) + 12345) & 0x7fffffff;
|
val = ((val * 1103515245) + 12345) & 0x7fffffff;
|
||||||
state[0] = val;
|
state[0] = val;
|
||||||
result = val;
|
result = val;
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user