svn commit: r319156 - head/lib/libnv/tests

Ngie Cooper ngie at FreeBSD.org
Mon May 29 18:39:29 UTC 2017


Author: ngie
Date: Mon May 29 18:39:28 2017
New Revision: 319156
URL: https://svnweb.freebsd.org/changeset/base/319156

Log:
  :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

Modified:
  head/lib/libnv/tests/nv_tests.cc

Modified: head/lib/libnv/tests/nv_tests.cc
==============================================================================
--- head/lib/libnv/tests/nv_tests.cc	Mon May 29 18:34:45 2017	(r319155)
+++ head/lib/libnv/tests/nv_tests.cc	Mon May 29 18:39:28 2017	(r319156)
@@ -640,6 +640,7 @@ ATF_TEST_CASE_BODY(nvlist_unpack__duplic
 	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


More information about the svn-src-head mailing list