From owner-svn-src-head@freebsd.org Sun Apr 16 03:34:42 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 7860AD40799; Sun, 16 Apr 2017 03:34:42 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 25199309; Sun, 16 Apr 2017 03:34:41 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id zaxNcUaVIsa1kzaxOcitIA; Sat, 15 Apr 2017 21:34:35 -0600 X-Authority-Analysis: v=2.2 cv=W+NIbVek c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=AzvcPWV-tVgA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=zm8RW0_Aktz8uO5TyfIA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id EEEB62028; Sat, 15 Apr 2017 20:34:32 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v3G3YWKc032550; Sat, 15 Apr 2017 20:34:32 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201704160334.v3G3YWKc032550@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: cem@freebsd.org cc: Cy Schubert , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316993 - head/contrib/ipfilter/lib In-Reply-To: Message from Conrad Meyer of "Sat, 15 Apr 2017 18:49:58 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 15 Apr 2017 20:34:32 -0700 X-CMAE-Envelope: MS4wfIEK3Bs2fGGmEUAhrkx56psDQGGFR0XxEblyMT8zu+RC/IKX//jPvHGpPahSMuDCSz4AM7VdW0LMPmV+LWnO37oqjhRr6Crpux1h631LZCx1qvqL5ztw y1OGO85KQwGWNUsigQ9c0apMC4Rw3Cl04lJpY5qb9CZdh9JWbP0NYUofDubRmxkIdb1+HVTguhqfr213DO+VX/BaA3WFoenVaEoITUB6MGuU9RVkdaNdZ8eH PNOJg/b/206Tg1kjzkNwmeSFjMk7iVDU3IMSHBXmiCOEWPtAqXrtP62U+Gedk75/PIWjCxVrm6w6abP9bgudCw== 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 03:34:42 -0000 In message , Conrad Meyer writes: > On Sat, Apr 15, 2017 at 6:13 PM, Cy Schubert wrote: > > 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(*fiel > ds)); > > + if (fields == NULL) { > > + perror("memory allocation error at __LINE__ > in __FUNCTIOIN__ in __FILE__"); > > Hey Cy, > > Does this actually work? I was under the impression it wouldn't work. > Instead, maybe warnx("... error at %d in %s in %s", __LINE__, > __func__, __FILE__)? You are indeed correct Conrad. My mistake. I'll fix it right away. Thanks for pointing this out. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few.