From owner-cvs-src@FreeBSD.ORG Fri Mar 18 07:55:17 2005 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 50F0C16A4CE; Fri, 18 Mar 2005 07:55:17 +0000 (GMT) Received: from storm.uk.FreeBSD.org (storm.uk.FreeBSD.org [194.242.157.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id B5C7F43D31; Fri, 18 Mar 2005 07:55:16 +0000 (GMT) (envelope-from mark@grondar.org) Received: from storm.uk.FreeBSD.org (uucp@localhost [127.0.0.1]) by storm.uk.FreeBSD.org (8.13.1/8.13.1) with ESMTP id j2I7tErw031456; Fri, 18 Mar 2005 07:55:14 GMT (envelope-from mark@grondar.org) Received: (from uucp@localhost)j2I7tDXD031455; Fri, 18 Mar 2005 07:55:13 GMT (envelope-from mark@grondar.org) Received: from grondar.org (localhost [127.0.0.1]) by grovel.grondar.org (8.13.3/8.13.1) with ESMTP id j2I7q2ur047721; Fri, 18 Mar 2005 07:52:02 GMT (envelope-from mark@grondar.org) Message-Id: <200503180752.j2I7q2ur047721@grovel.grondar.org> X-Mailer: exmh version 2.7.0 06/18/2004 with nmh-1.0.4 To: Poul-Henning Kamp From: Mark Murray In-Reply-To: Your message of "Fri, 18 Mar 2005 07:13:35 GMT." <200503180713.j2I7DZ7K065013@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 18 Mar 2005 07:52:02 +0000 Sender: mark@grondar.org cc: cvs-src@FreeBSD.ORG cc: src-committers@FreeBSD.ORG cc: cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/sys/dev/random randomdev_soft.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2005 07:55:17 -0000 Poul-Henning Kamp writes: > phk 2005-03-18 07:13:35 UTC > > FreeBSD src repository > > Modified files: > sys/dev/random randomdev_soft.c > Log: > Fix off-by-one (too little!) array size problem. > > Detected by: Coverity (ID#661) Erm, Coverity didn't get this right. The array size is given by the last constant in an enum; normally this would be one-too-small, so I put an extra thingy in the enum to make a "maxval", which is used here. A later KASSERT incorrectly asserts that the "maxval" is an acceptable value for the array index, so that possibly added to the confusion. The correct fix is to fix the KASSERT, and PHK has indicated that he won't object to me reversing his commit to sort things out this way. M -- Mark Murray iumop ap!sdn w,I idlaH