From owner-svn-src-all@freebsd.org Wed Dec 6 04:40:54 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 5C907E8FA2C; Wed, 6 Dec 2017 04:40:54 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 416962D50; Wed, 6 Dec 2017 04:40:53 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id vB64epl7040933 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 5 Dec 2017 20:40:52 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id vB64ep3s040932; Tue, 5 Dec 2017 20:40:51 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 5 Dec 2017 20:40:51 -0800 From: Gleb Smirnoff To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326574 - head/usr.bin/logger Message-ID: <20171206044051.GF1056@FreeBSD.org> References: <201712051955.vB5Jtrwp079953@repo.freebsd.org> <201712060430.vB64U74f068870@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="/NkBOFFp2J2Af1nK" Content-Disposition: inline In-Reply-To: <201712060430.vB64U74f068870@slippy.cwsent.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 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: Wed, 06 Dec 2017 04:40:54 -0000 --/NkBOFFp2J2Af1nK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Cy, On Tue, Dec 05, 2017 at 08:30:07PM -0800, Cy Schubert wrote: C> Hi Gleb, C> C> I'm getting a segfault here. C> C> [New LWP 101396] C> Core was generated by `logger -p daemon.notice -t local-dhclient(lagg0):4629 C> 2 dhclient-script for inter'. C> Program terminated with signal SIGSEGV, Segmentation fault. C> #0 0x0000000000402152 in main (argc=, argv=) C> at /opt/src/svn-current/usr.bin/logger/logger.c:186 C> 186 *strchr(hostname, '.') = '\0'; C> (gdb) bt C> #0 0x0000000000402152 in main (argc=, argv=) C> at /opt/src/svn-current/usr.bin/logger/logger.c:186 C> (gdb) Mea culpa! Can you please test the attached patch? -- Gleb Smirnoff --/NkBOFFp2J2Af1nK Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="logger.diff" Index: logger.c =================================================================== --- logger.c (revision 326614) +++ logger.c (working copy) @@ -183,7 +183,7 @@ main(int argc, char *argv[]) if (hostname == NULL) { hostname = hbuf; (void )gethostname(hbuf, MAXHOSTNAMELEN); - *strchr(hostname, '.') = '\0'; + *strchrnul(hostname, '.') = '\0'; } /* log input line if appropriate */ --/NkBOFFp2J2Af1nK--