Author: glebius
Date: Wed Dec 6 17:50:10 2017
New Revision: 326625
URL: https://svnweb.freebsd.org/changeset/base/326625
Log:
Fix crash with a dotless hostname.
Modified:
head/usr.bin/logger/logger.c
Modified: head/usr.bin/logger/logger.c
==============================================================================
--- head/usr.bin/logger/logger.c Wed Dec 6 17:01:25 2017
(r326624)
+++ head/usr.bin/logger/logger.c Wed Dec 6 17:50:10 2017
(r326625)
@@ -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 */
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"