diff --git a/sys/contrib/libnv/nvlist.c b/sys/contrib/libnv/nvlist.c index 8fcc24e40458..4aadbcbcf62e 100644 --- a/sys/contrib/libnv/nvlist.c +++ b/sys/contrib/libnv/nvlist.c @@ -1200,12 +1200,13 @@ nvlist_xunpack(const void *buf, size_t size, const int *fds, size_t nfds, &array); if (ptr == NULL) goto failed; + PJDLOG_ASSERT(array != NULL); tmpnvl = array; - while (array != NULL) { + do { nvlist_set_parent(array, nvp); array = __DECONST(nvlist_t *, nvlist_get_array_next(array)); - } + } while (array != NULL); ptr = nvlist_unpack_header(tmpnvl, ptr, nfds, &isbe, &left); break;