Fix RemoteSyslogChannel setProperty value check (#4339)

We compare just 4 first letters. So if value would have example be
syslevel then this function would work wrong. Nothing major but nice to
fix.

Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
This commit is contained in:
Kari Argillander 2023-12-13 04:36:37 +02:00 committed by GitHub
parent 10f41c06d9
commit 46759cab03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -176,7 +176,7 @@ void RemoteSyslogChannel::setProperty(const std::string& name, const std::string
std::string facility; std::string facility;
if (Poco::icompare(value, 4, "LOG_") == 0) if (Poco::icompare(value, 4, "LOG_") == 0)
facility = Poco::toUpper(value.substr(4)); facility = Poco::toUpper(value.substr(4));
else if (Poco::icompare(value, 4, "SYSLOG_") == 0) else if (Poco::icompare(value, 7, "SYSLOG_") == 0)
facility = Poco::toUpper(value.substr(7)); facility = Poco::toUpper(value.substr(7));
else else
facility = Poco::toUpper(value); facility = Poco::toUpper(value);