From 6399b5e03a662a6fd31324942b7d53f73028e0b7 Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Mon, 29 May 2017 18:39:28 +0000 Subject: [PATCH] :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 --- lib/libnv/tests/nv_tests.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libnv/tests/nv_tests.cc b/lib/libnv/tests/nv_tests.cc index 1c65b6664ffd..3464d20f2ec0 100644 --- a/lib/libnv/tests/nv_tests.cc +++ b/lib/libnv/tests/nv_tests.cc @@ -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