Re:Security flaws caused by compiler optimizations
by tinus_hn on Wednesday August 21, 2019 @02:30PM
(#20760035)
The assignment merely takes the address of tun and adds a small value. That wouldn’t cause a crash.
The surprise is that the if (!tun) check is optimized sway because if tun is NULL the assignment causes undefined behavior which the compiler does not have to take into account.
The surprise is that the if (!tun) check is optimized sway because if tun is NULL the assignment causes undefined behavior which the compiler does not have to take into account.