summaryrefslogtreecommitdiffstats
path: root/usr.sbin/syslogd/syslogd.c
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2015-07-16 23:29:14 +0000
committerbluhm <bluhm@openbsd.org>2015-07-16 23:29:14 +0000
commit76ac9a78efafb31ea6828b4740b0276f91a71109 (patch)
tree9e8df7c9047f98c2b25077b1284b1c30aaa1abbf /usr.sbin/syslogd/syslogd.c
parentFail if /etc/doas.conf is g+w or o+w or is not owned by root. ok tedu (diff)
downloadwireguard-openbsd-76ac9a78efafb31ea6828b4740b0276f91a71109.tar.xz
wireguard-openbsd-76ac9a78efafb31ea6828b4740b0276f91a71109.zip
When incrementing msg, decrement msglen. Otherwise too much data
could be written into the log file. OK benno@
Diffstat (limited to 'usr.sbin/syslogd/syslogd.c')
-rw-r--r--usr.sbin/syslogd/syslogd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index 63937e2f211..eb762595cbb 100644
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: syslogd.c,v 1.172 2015/07/09 16:01:48 bluhm Exp $ */
+/* $OpenBSD: syslogd.c,v 1.173 2015/07/16 23:29:14 bluhm Exp $ */
/*
* Copyright (c) 1983, 1988, 1993, 1994
@@ -1321,8 +1321,10 @@ logmsg(int pri, char *msg, char *from, int flags)
prilev = LOG_PRI(pri);
/* extract program name */
- while (isspace((unsigned char)*msg))
+ while (isspace((unsigned char)*msg)) {
msg++;
+ msglen--;
+ }
for (i = 0; i < NAME_MAX; i++) {
if (!isalnum((unsigned char)msg[i]) && msg[i] != '-')
break;