In message <20171206044051.gf1...@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=<optimized out>, argv=<optimized out> > ) > 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=<optimized out>, argv=<optimized out> > ) > 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 <cy.schub...@cschubert.com> FreeBSD UNIX: <c...@freebsd.org> Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"