From owner-svn-src-all@freebsd.org Sun Apr 16 01:50:07 2017 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 56D92D3519E; Sun, 16 Apr 2017 01:50:07 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC01E18E6; Sun, 16 Apr 2017 01:50:06 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wm0-f42.google.com with SMTP id o81so15115916wmb.1; Sat, 15 Apr 2017 18:50:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=02nqjgniJ9dQSXb2knYaGpPLIstMh8S8IlASkZnie3g=; b=SA6fM1PT26DtqYtCxK6hm10IqEWTfZ53Xe7YAgQBbaCb5Ey0s5IM8XmbQJCw8VXxHj I4GGaJ0SkYWFAupa1q+CDoWG3m91bA02iXtE11EohF82lDi4dWxqjJClYbpp0Z+O6KGG DSE5Ko0wIBUc1wo8dCof49Z0BzjYMljIoX1kj2PDYI1h9J4e03APGXFBCylq0DTsWDoY En3jbxVWpiTt99uuDcGGA/7LXpZnj/w+xZls9aD4B9OfBh62KElsnJLJhRkU/WDjh88s qcCWqHjX53u2UpyU0l1H/7BoUJsyhs8yhU5GhwtLjdraf6H5afKuZ8xekAInl6Idbk+P FBVQ== X-Gm-Message-State: AN3rC/4Zb/kqtrt4xov4jXGvl313vaNyjpQ89ovS98RTARG0z57KKj3G 4WyqU4+ziuvOntgJTlY= X-Received: by 10.28.86.68 with SMTP id k65mr4018304wmb.112.1492307399084; Sat, 15 Apr 2017 18:49:59 -0700 (PDT) Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com. [74.125.82.53]) by smtp.gmail.com with ESMTPSA id v8sm55641wrd.42.2017.04.15.18.49.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 15 Apr 2017 18:49:59 -0700 (PDT) Received: by mail-wm0-f53.google.com with SMTP id o81so15115852wmb.1; Sat, 15 Apr 2017 18:49:58 -0700 (PDT) X-Received: by 10.28.16.148 with SMTP id 142mr3836682wmq.75.1492307398778; Sat, 15 Apr 2017 18:49:58 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.80.169.4 with HTTP; Sat, 15 Apr 2017 18:49:58 -0700 (PDT) In-Reply-To: <201704160113.v3G1DlbA028401@repo.freebsd.org> References: <201704160113.v3G1DlbA028401@repo.freebsd.org> From: Conrad Meyer Date: Sat, 15 Apr 2017 18:49:58 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r316993 - head/contrib/ipfilter/lib To: Cy Schubert Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 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: Sun, 16 Apr 2017 01:50:07 -0000 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(*fields)); > + 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__)? Best, Conrad