svn commit: r326574 - head/usr.bin/logger
Cy Schubert
Cy.Schubert at komquats.com
Wed Dec 6 04:59:06 UTC 2017
In message <20171206044051.GF1056 at 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.Schubert at cschubert.com>
FreeBSD UNIX: <cy at FreeBSD.org> Web: http://www.FreeBSD.org
The need of the many outweighs the greed of the few.
More information about the svn-src-all
mailing list