From owner-svn-src-head@freebsd.org Sun Apr 16 01:13:48 2017 Return-Path: Delivered-To: svn-src-head@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 6E85DD3587E; Sun, 16 Apr 2017 01:13:48 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 40C7A1AF2; Sun, 16 Apr 2017 01:13:48 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3G1DlAT028402; Sun, 16 Apr 2017 01:13:47 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3G1DlbA028401; Sun, 16 Apr 2017 01:13:47 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201704160113.v3G1DlbA028401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 16 Apr 2017 01:13:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316993 - head/contrib/ipfilter/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Apr 2017 01:13:48 -0000 Author: cy Date: Sun Apr 16 01:13:47 2017 New Revision: 316993 URL: https://svnweb.freebsd.org/changeset/base/316993 Log: Fix CID 1372601, possible NULL pointer dereference should reallocarray() fail. Reported by: Coverity CID 1372601 MFC after: 1 week Modified: head/contrib/ipfilter/lib/parsefields.c Modified: head/contrib/ipfilter/lib/parsefields.c ============================================================================== --- head/contrib/ipfilter/lib/parsefields.c Sat Apr 15 23:35:57 2017 (r316992) +++ head/contrib/ipfilter/lib/parsefields.c Sun Apr 16 01:13:47 2017 (r316993) @@ -32,6 +32,10 @@ wordtab_t *parsefields(table, arg) fields = malloc(2 * sizeof(*fields)); } else { fields = reallocarray(fields, num + 1, sizeof(*fields)); + if (fields == NULL) { + perror("memory allocation error at __LINE__ in __FUNCTIOIN__ in __FILE__"); + abort(); + } } if (t == NULL) {