Re: gcc 4.1 bug miscompiles pointer range checks, may place you at risk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



perhaps instead of "c + len > c" being the test of pointer wraparound, one may use the following (if there is a desire to use pointer-based arithmetic)...

#define MAXPTR (char *)0xffffffff // this would differ on 64 bit systems

if (MAXPTR - c < len)
{
// we have a pointer wraparound...
}

[Index of Archives]     [Linux Security]     [Netfilter]     [PHP]     [Yosemite News]     [Linux Kernel]

  Powered by Linux