BugTraq
Re: gcc 4.1 bug miscompiles pointer range checks, may place you at risk May 03 2006 07:21AM
leonleon77 hotmail com (1 replies)
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...

}

[ reply ]
Re: gcc 4.1 bug miscompiles pointer range checks, may place you atrisk May 05 2006 05:17AM
Tonnerre Lombard (tonnerre lombard sygroup ch)


 

Privacy Statement
Copyright 2010, SecurityFocus