Re:Who Says C is Simple?
by dietrichepp on Wednesday July 17, 2013 @02:35PM
(#6059362)
In that case, it's your fault for defining two versions of a function (inline and non-inline) that do different things.
[ Parent
| on HN ]
Even if you don't do something like that a modern C compiler will do all sorts of things behind your back. Like removing null checks[1] or pointer overflow checks[2]
Well, to be fair, the NULL check was in a wrong place. The pointer was already dereferenced before the check.
struct tun_struct *tun = __tun_get(tfile);
struct sock *sk = tun->sk;
unsigned int mask = 0;
if (!tun)
return POLLERR;