Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157181671
D12760.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D12760.id.diff
View Options
Index: head/sys/contrib/libnv/nvlist.c
===================================================================
--- head/sys/contrib/libnv/nvlist.c
+++ head/sys/contrib/libnv/nvlist.c
@@ -707,15 +707,17 @@
static int *
nvlist_xdescriptors(const nvlist_t *nvl, int *descs)
{
+ void *cookie;
nvpair_t *nvp;
int type;
NVLIST_ASSERT(nvl);
PJDLOG_ASSERT(nvl->nvl_error == 0);
- nvp = NULL;
+ cookie = NULL;
do {
- while (nvlist_next(nvl, &type, (void *)&nvp) != NULL) {
+ while (nvlist_next(nvl, &type, &cookie) != NULL) {
+ nvp = cookie;
switch (type) {
case NV_TYPE_DESCRIPTOR:
*descs = nvpair_get_descriptor(nvp);
@@ -737,7 +739,7 @@
}
case NV_TYPE_NVLIST:
nvl = nvpair_get_nvlist(nvp);
- nvp = NULL;
+ cookie = NULL;
break;
case NV_TYPE_NVLIST_ARRAY:
{
@@ -749,12 +751,12 @@
PJDLOG_ASSERT(nitems > 0);
nvl = value[0];
- nvp = NULL;
+ cookie = NULL;
break;
}
}
}
- } while ((nvl = nvlist_get_pararr(nvl, (void *)&nvp)) != NULL);
+ } while ((nvl = nvlist_get_pararr(nvl, &cookie)) != NULL);
return (descs);
}
@@ -784,6 +786,7 @@
nvlist_ndescriptors(const nvlist_t *nvl)
{
#ifndef _KERNEL
+ void *cookie;
nvpair_t *nvp;
size_t ndescs;
int type;
@@ -792,16 +795,17 @@
PJDLOG_ASSERT(nvl->nvl_error == 0);
ndescs = 0;
- nvp = NULL;
+ cookie = NULL;
do {
- while (nvlist_next(nvl, &type, (void *)&nvp) != NULL) {
+ while (nvlist_next(nvl, &type, &cookie) != NULL) {
+ nvp = cookie;
switch (type) {
case NV_TYPE_DESCRIPTOR:
ndescs++;
break;
case NV_TYPE_NVLIST:
nvl = nvpair_get_nvlist(nvp);
- nvp = NULL;
+ cookie = NULL;
break;
case NV_TYPE_NVLIST_ARRAY:
{
@@ -813,7 +817,7 @@
PJDLOG_ASSERT(nitems > 0);
nvl = value[0];
- nvp = NULL;
+ cookie = NULL;
break;
}
case NV_TYPE_DESCRIPTOR_ARRAY:
@@ -827,7 +831,7 @@
}
}
}
- } while ((nvl = nvlist_get_pararr(nvl, (void *)&nvp)) != NULL);
+ } while ((nvl = nvlist_get_pararr(nvl, &cookie)) != NULL);
return (ndescs);
#else
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, May 20, 2:20 AM (18 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33335336
Default Alt Text
D12760.id.diff (2 KB)
Attached To
Mode
D12760: libnv: Fix strict-aliasing violation with cookie
Attached
Detach File
Event Timeline
Log In to Comment