summaryrefslogtreecommitdiffstats
path: root/usr.sbin/syslogd/syslogd.c
diff options
context:
space:
mode:
authortobias <tobias@openbsd.org>2014-12-06 12:18:32 +0000
committertobias <tobias@openbsd.org>2014-12-06 12:18:32 +0000
commita83d77220c732524f54467d0bc7f00cbca60bd1c (patch)
tree6448e0088de7db21a1c1f2a7fed384e7cc8af70f /usr.sbin/syslogd/syslogd.c
parentIf "machdep.lidsuspend" is not set, do not go back to sleep if the lid (diff)
downloadwireguard-openbsd-a83d77220c732524f54467d0bc7f00cbca60bd1c.tar.xz
wireguard-openbsd-a83d77220c732524f54467d0bc7f00cbca60bd1c.zip
Verify that facility and priority numbers are in valid ranges.
ok bluhm
Diffstat (limited to 'usr.sbin/syslogd/syslogd.c')
-rw-r--r--usr.sbin/syslogd/syslogd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index 1b739ae3eb5..0a41c3d353b 100644
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: syslogd.c,v 1.132 2014/12/03 17:00:15 millert Exp $ */
+/* $OpenBSD: syslogd.c,v 1.133 2014/12/06 12:18:32 tobias Exp $ */
/*
* Copyright (c) 1983, 1988, 1993, 1994
@@ -1498,7 +1498,7 @@ cfline(char *line, char *prog)
}
pri = decode(buf, prioritynames);
- if (pri < 0) {
+ if (pri < 0 || pri > LOG_PRIMASK) {
(void)snprintf(ebuf, sizeof ebuf,
"unknown priority name \"%s\"", buf);
logerror(ebuf);
@@ -1517,7 +1517,7 @@ cfline(char *line, char *prog)
f->f_pmask[i] = pri;
else {
i = decode(buf, facilitynames);
- if (i < 0) {
+ if (i < 0 || (i >> 3) > LOG_NFACILITIES) {
(void)snprintf(ebuf, sizeof(ebuf),
"unknown facility name \"%s\"",
buf);