From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 08:55:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EACCB8E2; Wed, 3 Sep 2014 08:55:34 +0000 (UTC) Received: from mail-wi0-x236.google.com (mail-wi0-x236.google.com [IPv6:2a00:1450:400c:c05::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 12094150D; Wed, 3 Sep 2014 08:55:33 +0000 (UTC) Received: by mail-wi0-f182.google.com with SMTP id z2so9333386wiv.15 for ; Wed, 03 Sep 2014 01:55:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=bsv/k5TUKUCqGAc5QdjUbDjEYPL2gVZUwiMZ2QFqHUk=; b=0eeLzetZguaiVyyyAFzBrpfxw/ilCLXfTPK5m+Sb6vbnFMVYIQcXNqgKJwPKoMKPwg 9W8mKqJd7+z2CFTg/uPPniRErVl4Alqh7e2nI9tVhZ4KszTEE/A+WNQ2NucRiO3ohuYc o3vDfsBqL6x8XqSjsvS/FoD10+HsvSCT6SUy9uIK0LmM0SnRFggApTTgoxaBQFsWtvuv Q0nTxSiUKtrW+0GeafPELDItojK4MSa9nIj7hanVE8+SfC+AgAFxQcpKbzmseCICLbaj oqsazc5wjFeo3Gp75O156zwwatcgBEY2B13QiUHrHfWqyCpyrQiPyoEH9y9ZHw5mRzYj LdQw== X-Received: by 10.194.81.37 with SMTP id w5mr46169485wjx.12.1409734532323; Wed, 03 Sep 2014 01:55:32 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id xm4sm3323353wib.9.2014.09.03.01.55.30 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 03 Sep 2014 01:55:31 -0700 (PDT) Date: Wed, 3 Sep 2014 10:55:23 +0200 From: Mateusz Guzik To: Gleb Smirnoff Subject: Re: svn commit: r270999 - head/sys/kern Message-ID: <20140903085523.GB13871@dft-labs.eu> References: <201409030814.s838E7A2084257@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201409030814.s838E7A2084257@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 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: Wed, 03 Sep 2014 08:55:35 -0000 On Wed, Sep 03, 2014 at 08:14:07AM +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Wed Sep 3 08:14:07 2014 > New Revision: 270999 > URL: http://svnweb.freebsd.org/changeset/base/270999 > > Log: > Fix dereference after NULL check. > > CID: 1234607 > Sponsored by: Nginx, Inc. > > Modified: > head/sys/kern/kern_proc.c > > Modified: head/sys/kern/kern_proc.c > ============================================================================== > --- head/sys/kern/kern_proc.c Wed Sep 3 08:13:46 2014 (r270998) > +++ head/sys/kern/kern_proc.c Wed Sep 3 08:14:07 2014 (r270999) > @@ -921,10 +921,11 @@ fill_kinfo_proc_only(struct proc *p, str > kp->ki_xstat = p->p_xstat; > kp->ki_acflag = p->p_acflag; > kp->ki_lock = p->p_lock; > - if (p->p_pptr) > + if (p->p_pptr) { > kp->ki_ppid = proc_realparent(p)->p_pid; > - if (p->p_flag & P_TRACED) > - kp->ki_tracer = p->p_pptr->p_pid; > + if (p->p_flag & P_TRACED) > + kp->ki_tracer = p->p_pptr->p_pid; > + } > } > > /* > p_pptr must be non-NULL if P_TRACED is set. If there is no way to annotate it for coverity, this change deserves a comment in the code (and in retrospect previous code should have had appropriate comment as well). -- Mateusz Guzik