From: bluhm Date: Wed, 4 May 2022 14:47:46 +0000 (+0000) Subject: Variable pri is uninitialized, use msg.m_pri instead. This affects X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a05e7777f7f79e4b71ebbb8edd6e48ae30d94047;p=openbsd Variable pri is uninitialized, use msg.m_pri instead. This affects the priority of userland messages with kernel or unspecified facility. broken in previous commit; fix from markus@ --- diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index d44b311ae16..4942a89ee71 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syslogd.c,v 1.273 2022/01/13 10:34:07 martijn Exp $ */ +/* $OpenBSD: syslogd.c,v 1.274 2022/05/04 14:47:46 bluhm Exp $ */ /* * Copyright (c) 2014-2021 Alexander Bluhm @@ -1562,7 +1562,6 @@ usage(void) void printline(char *hname, char *msgstr) { - int pri; struct msg msg; char *p, *q, line[LOG_MAXLINE + 4 + 1]; /* message, encoding, NUL */ @@ -1584,7 +1583,7 @@ printline(char *hname, char *msgstr) * messages with no facility specified. */ if (LOG_FAC(msg.m_pri) == LOG_KERN) - msg.m_pri = LOG_USER | LOG_PRI(pri); + msg.m_pri = LOG_USER | LOG_PRI(msg.m_pri); if (msg.m_timestamp[0] == '\0') current_time(msg.m_timestamp);