[Full-disclosure] Major gcc 4.1.1 and up security issue

Marcus Graf m.graf at shoplogistics.de
Wed Jan 17 18:07:19 GMT 2007


off topic thoughts:

> (twice 1.15 will likely be a bit or two different than 3.30).  As Fortran
> geeks have known for over half a century, a better way to code this is:
> 
> 	if (abs(a-b) < n*epsilon*a)
> 
> where 'epsilon' is the hardware constant defining the smallest number such
> that 1+a is different from 1, and 'n' controls how many significant digits
> we require in the test.

Hm...

assume a = b = -1.0

abs(a-b) is zero or maybe a little bit above
n*epsilon*a is negative (n>0, epsilon>0, a=-1)

Test fails :-(

Just my $0.02

Ciao
Marcus

-- 
Hail Eris! Hail Discordia!




Full-Disclosure is hosted and sponsored by Secunia.