diff --git a/rsyslog-8.10.0-imjournal-empty-messages.patch b/rsyslog-8.10.0-imjournal-empty-messages.patch new file mode 100644 index 0000000..8857c7f --- /dev/null +++ b/rsyslog-8.10.0-imjournal-empty-messages.patch @@ -0,0 +1,40 @@ +From f1f77872ab6e962fcc7f53c0b51ef7b2d331c1bf Mon Sep 17 00:00:00 2001 +From: Tomas Heinrich +Date: Tue, 23 Jun 2015 18:09:52 +0200 +Subject: [PATCH 1/4] imjournal: don't sanitize empty messages + +It is an error to pass an empty message to +parser.SanitizeMsg() and doing so could crash the daemon. Besides, +there's no point in doing so in the first place. +--- + plugins/imjournal/imjournal.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/plugins/imjournal/imjournal.c b/plugins/imjournal/imjournal.c +index b5866e8..6ad9fca 100644 +--- a/plugins/imjournal/imjournal.c ++++ b/plugins/imjournal/imjournal.c +@@ -176,6 +176,7 @@ enqMsg(uchar *msg, uchar *pszTag, int iFacility, int iSeverity, struct timeval * + { + struct syslogTime st; + msg_t *pMsg; ++ size_t len; + DEFiRet; + + assert(msg != NULL); +@@ -189,8 +190,10 @@ enqMsg(uchar *msg, uchar *pszTag, int iFacility, int iSeverity, struct timeval * + } + MsgSetFlowControlType(pMsg, eFLOWCTL_LIGHT_DELAY); + MsgSetInputName(pMsg, pInputName); +- MsgSetRawMsgWOSize(pMsg, (char*)msg); +- parser.SanitizeMsg(pMsg); ++ len = strlen((char*)msg); ++ MsgSetRawMsg(pMsg, (char*)msg, len); ++ if(len > 0) ++ parser.SanitizeMsg(pMsg); + MsgSetMSGoffs(pMsg, 0); /* we do not have a header... */ + MsgSetRcvFrom(pMsg, glbl.GetLocalHostNameProp()); + MsgSetRcvFromIP(pMsg, pLocalHostIP); +-- +1.9.3 + diff --git a/rsyslog.spec b/rsyslog.spec index 17c02ab..21f7883 100644 --- a/rsyslog.spec +++ b/rsyslog.spec @@ -26,6 +26,8 @@ Patch0: rsyslog-8.8.0-sd-service.patch # prevent modification of trusted properties (proposed upstream) Patch1: rsyslog-8.8.0-immutable-json-props.patch Patch2: rsyslog-8.8.0-missing-test-data.patch +# https://github.com/rsyslog/rsyslog/pull/412 +Patch3: rsyslog-8.10.0-imjournal-empty-messages.patch BuildRequires: bison BuildRequires: dos2unix @@ -251,6 +253,7 @@ mv build doc %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 %build %ifarch sparc64 @@ -508,6 +511,8 @@ done resolves: rhbz#1228192 - use systemctl for sending SIGHUP to the service related: rhbz#1224972 +- add a patch to prevent a crash on empty messages + resolves: rhbz#1224538 * Thu Jun 18 2015 Fedora Release Engineering - 8.8.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild