Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Aug 2006 18:46:13 +0200
From:      Frederic Praca <frederic.praca@freebsd-fr.org>
To:        freebsd-hackers@freebsd.org
Subject:   Latest patch for PPP
Message-ID:  <20060825184613.3389e895@localhost.darkstar>

next in thread | raw e-mail | index | archive | help
Hello,
in the latest security advisory for PPP, the patch deals with conditions
in a for loop. The correct line is :
for (rlen=0; len >= 2 && p[1] >= 2 && len >= p[1]; len-=p[1], p+=p[1]) {

Couldn't the condition be simpler like :
for (rlen=0; p[1] >= 2 && len >= p[1]; len-=p[1], p+=p[1]){

Or is there a hack I didn't understand ?
In this case, if p[1] is greater or equal than 2, if we ensure that len
>= p[1], we don't have to test that it's greater or equal than 2, isn't
>it ?

Fred



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060825184613.3389e895>