From owner-svn-src-head@freebsd.org Wed Dec 6 04:59:06 2017 Return-Path: Delivered-To: svn-src-head@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 54058E9091D; Wed, 6 Dec 2017 04:59:06 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0522D3847; Wed, 6 Dec 2017 04:59:05 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id MRnMeLRiap2osMRnNewQDM; Tue, 05 Dec 2017 21:58:58 -0700 X-Authority-Analysis: v=2.2 cv=KLEqNBNo c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=ocR9PWop10UA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=3JR1sUh4GS8n-EOMUQQA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 51004303; Tue, 5 Dec 2017 20:58:56 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id vB64wtfl005015; Tue, 5 Dec 2017 20:58:55 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id vB64wtWS004930; Tue, 5 Dec 2017 20:58:55 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201712060458.vB64wtWS004930@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Gleb Smirnoff cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326574 - head/usr.bin/logger In-Reply-To: Message from Gleb Smirnoff of "Tue, 05 Dec 2017 20:40:51 -0800." <20171206044051.GF1056@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 05 Dec 2017 20:58:55 -0800 X-CMAE-Envelope: MS4wfK4m3YjWUul60KXamsCTRNuaAnHXw9v0RW3bIQ2BCGdgJp/KQkVeKu6GmbmM88sGXrlH4xvYou/s94gF5ywn8FubsCMaJt9aH+qNikEYlDwNk724Glv8 i7SvJqGOe6AHQU/TXLQLxU7ADyS5Txew+6yFtznhBIS2AMi+vcohmtnyISKpm1Z7Z+FvrzfM37cXCCHKk9ahwdJ8ULUAZqepH0QdqO9qD6pyG3/JO6xrJjlb e92h690jkmVHyqwcPwiY+kbhyX+RYQRpWb6Vpsu6YfRDi65svWpraMNTxiZ0xlkU X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 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, 06 Dec 2017 04:59:06 -0000 In message <20171206044051.GF1056@FreeBSD.org>, Gleb Smirnoff writes: > > > --/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):46 > 29 > 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-- Fixed. Thanks! -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few.