From b4e852907fb279d9ff755f56cf76d1286c3c7396 Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Mon, 28 Mar 2005 10:59:19 +0000 Subject: [PATCH] Check that supplied facility is not bigger than LOG_NFACILITIES. PR: bin/79260 Submitted by: Shuichi KITAGUCHI --- usr.sbin/syslogd/syslogd.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index bfc424849d7f..52f757b53c45 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -916,6 +916,13 @@ logmsg(int pri, const char *msg, const char *from, int flags) fac = LOG_NFACILITIES; else fac = LOG_FAC(pri); + + /* Check maximum facility number. */ + if (fac > LOG_NFACILITIES) { + (void)sigsetmask(omask); + return; + } + prilev = LOG_PRI(pri); /* extract program name */