Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Jan 2016 19:32:11 -0800
From:      NGie Cooper <yaneurabeya@gmail.com>
To:        Garrett Cooper <ngie@FreeBSD.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r293134 - head/lib/libnv/tests
Message-ID:  <4C70AA03-F9C7-44A7-B9DE-5A6ABF108FC9@gmail.com>
In-Reply-To: <201601040326.u043Qa46007717@repo.freebsd.org>
References:  <201601040326.u043Qa46007717@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

> On Jan 3, 2016, at 19:26, Garrett Cooper <ngie@FreeBSD.org> wrote:
>=20
> Author: ngie
> Date: Mon Jan  4 03:26:36 2016
> New Revision: 293134
> URL: https://svnweb.freebsd.org/changeset/base/293134
>=20
> Log:
>  Use `nitems(x)` macro instead of using hardcoded numbers for indices =
into
>  the nvlists
>=20
>  Convert some of the variables from int to unsigned int to squelch =
-Wsign-compare
>  warnings when converting hardcoded values to nitems(..)
>=20
>  Differential Revision: https://reviews.freebsd.org/D4769 (part of =
larger diff)
>  MFC after: 5 days
>  Reviewed by: oshogbo
>  Sponsored by: EMC / Isilon Storage Division

...

> -		for (i =3D 0; i < num_items; i++)
> +		for (i =3D 0; i < nitems(desc); i++)

This portion of the change also fixed an out-of-bounds memory access on =
stable/10 that oshogbo spent some time poring over why this testcase (in =
particular) kept on crashing as num_items was never properly initialized =
in this code path.

Reported by: cppcheck

Thanks!
-NGie=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C70AA03-F9C7-44A7-B9DE-5A6ABF108FC9>