From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 25 17:05:16 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E9B2616A4E0 for ; Fri, 25 Aug 2006 17:05:16 +0000 (UTC) (envelope-from frederic.praca@freebsd-fr.org) Received: from swip.net (mailfe05.tele2.fr [212.247.154.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2CE7B43D55 for ; Fri, 25 Aug 2006 17:05:07 +0000 (GMT) (envelope-from frederic.praca@freebsd-fr.org) X-T2-Posting-ID: si/BYDnMcLMCSRAzvRV5qDzvZpSo+m8/C5DygMCCiGw= X-Cloudmark-Score: 0.000000 [] Received: from [83.179.125.154] (HELO localhost.darkstar) by mailfe05.swip.net (CommuniGate Pro SMTP 5.0.8) with ESMTPS id 163296567 for freebsd-hackers@freebsd.org; Fri, 25 Aug 2006 19:05:05 +0200 Received: from localhost.darkstar (localhost.darkstar [127.0.0.1]) by localhost.darkstar (8.13.6/8.13.4/Frédéric PRACA - 05/12/2003) with ESMTP id k7PGkDMS000978 for ; Fri, 25 Aug 2006 18:46:14 +0200 (CEST) (envelope-from frederic.praca@freebsd-fr.org) Date: Fri, 25 Aug 2006 18:46:13 +0200 From: Frederic Praca To: freebsd-hackers@freebsd.org Message-ID: <20060825184613.3389e895@localhost.darkstar> X-Mailer: Sylpheed-Claws 2.4.0 (GTK+ 2.8.12; i386-portbld-freebsd6.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Latest patch for PPP X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Aug 2006 17:05:17 -0000 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