From owner-svn-src-head@FreeBSD.ORG Fri Nov 16 01:16:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3FA94435 for ; Fri, 16 Nov 2012 01:16:14 +0000 (UTC) (envelope-from postmaster@mailpod.hostingplatform.com) Received: from atl4mhob15.myregisteredsite.com (atl4mhob15.myregisteredsite.com [209.17.115.53]) by mx1.freebsd.org (Postfix) with ESMTP id E6A208FC17 for ; Fri, 16 Nov 2012 01:16:13 +0000 (UTC) Received: from mailpod1.hostingplatform.com (mailpod1.networksolutionsemail.com [206.188.198.65]) by atl4mhob15.myregisteredsite.com (8.14.4/8.14.4) with ESMTP id qAG1GDVD012478 for ; Thu, 15 Nov 2012 20:16:13 -0500 Received: (qmail 24200 invoked by uid 0); 16 Nov 2012 01:16:13 -0000 Received: (qmail 18252 invoked by uid 0); 15 Nov 2012 15:50:27 -0000 Received: (qmail 8102 invoked by uid 0); 15 Nov 2012 15:07:48 -0000 Received: from unknown (HELO atl4mhib43.myregisteredsite.com) (209) by 0 with SMTP; 15 Nov 2012 15:07:48 -0000 Received: from mx2.freebsd.org (mx2.freebsd.org [69.147.83.53]) by atl4mhib43.myregisteredsite.com (8.14.4/8.14.4) with ESMTP id qAFF7iNC003730 for ; Thu, 15 Nov 2012 10:07:45 -0500 Received: from hub.freebsd.org (hub.FreeBSD.org [8.8.178.136]) by mx2.freebsd.org (Postfix) with ESMTP id 331D53B5E86; Thu, 15 Nov 2012 15:07:40 +0000 (UTC) Received: from hub.FreeBSD.org (hub.FreeBSD.org [8.8.178.136]) by hub.freebsd.org (Postfix) with ESMTP id D1C2D1305; Thu, 15 Nov 2012 15:07:40 +0000 (UTC) (envelope-from owner-svn-src-all@freebsd.org) Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CE6FF74B; Thu, 15 Nov 2012 15:06:18 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 86C188FC13; Thu, 15 Nov 2012 15:06:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAFF6IBA004079; Thu, 15 Nov 2012 15:06:18 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAFF6IBk004078; Thu, 15 Nov 2012 15:06:18 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211151506.qAFF6IBk004078@svn.freebsd.org> From: Eitan Adler Date: Thu, 15 Nov 2012 15:06:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243081 - head/usr.bin/chpass X-SVN-Group: head MIME-Version: 1.0 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: owner-svn-src-all@freebsd.org Sender: owner-svn-src-all@freebsd.org X-SpamScore: 0 X-MailHub-Apparently-To: mjm@michaelmeltzer.com X-MailHub-Forwarded: Yes X-BeenThere: svn-src-head@freebsd.org 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: Fri, 16 Nov 2012 01:16:14 -0000 Author: eadler Date: Thu Nov 15 15:06:18 2012 New Revision: 243081 URL: http://svnweb.freebsd.org/changeset/base/243081 Log: Avoid possible null deref if ypclnt_new returns null PR: bin/172979 Submitted by: Erik Cederstrand Approved by: cperciva MFC after: 3 days Modified: head/usr.bin/chpass/chpass.c Modified: head/usr.bin/chpass/chpass.c ============================================================================== --- head/usr.bin/chpass/chpass.c Thu Nov 15 15:06:15 2012 (r243080) +++ head/usr.bin/chpass/chpass.c Thu Nov 15 15:06:18 2012 (r243081) @@ -241,8 +241,11 @@ main(int argc, char *argv[]) #ifdef YP case _PWF_NIS: ypclnt = ypclnt_new(yp_domain, "passwd.byname", yp_host); - if (ypclnt == NULL || - ypclnt_connect(ypclnt) == -1 || + if (ypclnt == NULL) { + warnx("ypclnt_new failed"); + exit(1); + } + if (ypclnt_connect(ypclnt) == -1 || ypclnt_passwd(ypclnt, pw, password) == -1) { warnx("%s", ypclnt->error); ypclnt_free(ypclnt); _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"