From owner-svn-src-all@freebsd.org Tue Aug 11 17:54:52 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B88E599F7CF; Tue, 11 Aug 2015 17:54:52 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A980CBF5; Tue, 11 Aug 2015 17:54:52 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7BHsq15056145; Tue, 11 Aug 2015 17:54:52 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7BHsqXb056144; Tue, 11 Aug 2015 17:54:52 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201508111754.t7BHsqXb056144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Tue, 11 Aug 2015 17:54:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286644 - head/sys/contrib/libnv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Aug 2015 17:54:52 -0000 Author: oshogbo Date: Tue Aug 11 17:54:51 2015 New Revision: 286644 URL: https://svnweb.freebsd.org/changeset/base/286644 Log: 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) Modified: head/sys/contrib/libnv/nvlist.c Modified: head/sys/contrib/libnv/nvlist.c ============================================================================== --- head/sys/contrib/libnv/nvlist.c Tue Aug 11 17:48:58 2015 (r286643) +++ head/sys/contrib/libnv/nvlist.c Tue Aug 11 17:54:51 2015 (r286644) @@ -824,6 +824,8 @@ nvlist_xunpack(const void *buf, size_t s 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