Date: Fri, 18 Mar 2005 07:52:02 +0000 From: Mark Murray <markm@FreeBSD.ORG> To: Poul-Henning Kamp <phk@FreeBSD.ORG> Cc: cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/sys/dev/random randomdev_soft.c Message-ID: <200503180752.j2I7q2ur047721@grovel.grondar.org> In-Reply-To: Your message of "Fri, 18 Mar 2005 07:13:35 GMT." <200503180713.j2I7DZ7K065013@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200503180752.j2I7q2ur047721>