Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 May 2017 18:39:28 +0000 (UTC)
From:      Ngie Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r319156 - head/lib/libnv/tests
Message-ID:  <201705291839.v4TIdSUT037303@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705291839.v4TIdSUT037303>