Check that supplied facility is not bigger than LOG_NFACILITIES.

PR:		bin/79260
Submitted by:	Shuichi KITAGUCHI
This commit is contained in:
Gleb Smirnoff 2005-03-28 10:59:19 +00:00
parent 63575b5712
commit b4e852907f

View File

@ -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 */