Don't set parent if the unpack operation fail. In some

case this could crash the library, because of the NULL pointer references.

Discovered thanks to american fuzzy lop.

Approved by:	pjd (mentor)
This commit is contained in:
Mariusz Zaborski 2015-08-11 17:54:51 +00:00
parent d99337805f
commit 51dae13f0e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=286644

View File

@ -824,6 +824,8 @@ nvlist_xunpack(const void *buf, size_t size, const int *fds, size_t nfds,
case NV_TYPE_NVLIST:
ptr = nvpair_unpack_nvlist(isbe, nvp, ptr, &left, nfds,
&tmpnvl);
if (tmpnvl == NULL || ptr == NULL)
goto failed;
nvlist_set_parent(tmpnvl, nvp);
break;
#ifndef _KERNEL