:nvlist_unpack__duplicate_key : check the result of nvlist_pack(3)

This fixes a potential NULL pointer dereference.

MFC after:	3 days
Reported by:	Coverity
CID:		1362051
Sponsored by:	Dell EMC Isilon
This commit is contained in:
Enji Cooper 2017-05-29 18:39:28 +00:00
parent 2c6778ed5b
commit 6399b5e03a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=319156

View File

@ -640,6 +640,7 @@ ATF_TEST_CASE_BODY(nvlist_unpack__duplicate_key)
nvlist_add_number(nvl, key2, 10);
packed = nvlist_pack(nvl, &size);
ATF_REQUIRE(packed != NULL);
/*
* Mangle the packed nvlist by replacing key1 with key2, creating a