From owner-svn-src-all@FreeBSD.ORG Thu Apr 4 22:07:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EA0B3AFE; Thu, 4 Apr 2013 22:07:39 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-jnhn.mail.uoguelph.ca (esa-jnhn.mail.uoguelph.ca [131.104.91.44]) by mx1.freebsd.org (Postfix) with ESMTP id 52375FD2; Thu, 4 Apr 2013 22:07:38 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqAEALb4XVGDaFvO/2dsb2JhbABDhmS6fYJkgRt0gh8BAQUjBFIbGAICDRkCWQaIJ68kkkqBI41EATMHgi2BEwOWbol1hxiDJyCBbA X-IronPort-AV: E=Sophos;i="4.87,411,1363147200"; d="scan'208";a="24496452" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-jnhn.mail.uoguelph.ca with ESMTP; 04 Apr 2013 18:07:38 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 67500B4035; Thu, 4 Apr 2013 18:07:38 -0400 (EDT) Date: Thu, 4 Apr 2013 18:07:38 -0400 (EDT) From: Rick Macklem To: Gleb Smirnoff Message-ID: <2007861569.528886.1365113258414.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <20130404152046.GO76816@FreeBSD.org> Subject: Re: svn commit: r249096 - head/sys/rpc/rpcsec_gss MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.202] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - IE8 (Win)/6.0.10_GA_2692) Cc: svn-src-head@freebsd.org, "George V. Neville-Neil" , svn-src-all@freebsd.org, src-committers@freebsd.org, rmacklem@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 04 Apr 2013 22:07:40 -0000 Glebius wrote: > George, Rick, > > On Thu, Apr 04, 2013 at 03:16:54PM +0000, George V. Neville-Neil > wrote: > G> Modified: head/sys/rpc/rpcsec_gss/rpcsec_gss_prot.c > G> > ============================================================================== > G> --- head/sys/rpc/rpcsec_gss/rpcsec_gss_prot.c Thu Apr 4 15:03:12 > 2013 (r249095) > G> +++ head/sys/rpc/rpcsec_gss/rpcsec_gss_prot.c Thu Apr 4 15:16:53 > 2013 (r249096) > G> @@ -208,6 +208,8 @@ m_trim(struct mbuf *m, int len) > G> struct mbuf *n; > G> int off; > G> > G> + if (m == NULL) > G> + return; > G> n = m_getptr(m, len, &off); > G> if (n) { > G> n->m_len = off; > > I think the code will be much more rocksolid, if the function won't be > called with NULL argument. > Oops, my confusion. I thought you were suggesting the above change. I suppose the callers should be fixed as well, but having the check here seems like a good idea? Feel free to add code to the callers to check for a NULL m arguement, rick > -- > Totus tuus, Glebius.