freebsd-dev/sys/contrib/libnv
Jilles Tjoelker 9a8ce256ed libnv: Fix strict-aliasing violation with cookie
In rS323851, some casts were adjusted in calls to nvlist_next() and
nvlist_get_pararr() in order to make scan-build happy. I think these changes
just confused scan-build into not reporting the strict-aliasing violation.

For example, nvlist_xdescriptors() is causing nvlist_next() to write to its
local variable nvp of type nvpair_t * using the lvalue *cookiep of type
void *, which is not allowed. Given the APIs of nvlist_next(),
nvlist_get_parent() and nvlist_get_pararr(), one possible fix is to create a
local void *cookie in nvlist_xdescriptors() and other places, and to convert
the value to nvpair_t * when necessary. This patch implements that fix.

Reviewed by:	oshogbo
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D12760
2017-10-26 18:32:04 +00:00
..
cnvlist.c Fix style issue in the cnv API. 2016-08-27 13:40:27 +00:00
dnvlist.c
nv_impl.h Add support for the arrays in nvlist library. 2015-08-15 06:34:49 +00:00
nvlist_impl.h Add cnv API. 2016-08-27 13:37:30 +00:00
nvlist.c libnv: Fix strict-aliasing violation with cookie 2017-10-26 18:32:04 +00:00
nvpair_impl.h Add support for the arrays in nvlist library. 2015-08-15 06:34:49 +00:00
nvpair.c Plug memory leak in case when nvlist allocation succeeds, but nvpair 2017-09-21 10:28:22 +00:00