diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2010-07-28 18:20:13 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2010-07-28 18:20:13 +0200 |
commit | 3c1895a699f7d37b49f41f6f758ead4abea0caf2 (patch) | |
tree | c6566f2c3193ef7bd2d9f6b8aae5c5f518a14a14 | |
parent | 707df8c1618036c09d216f482161e28692d57989 (diff) | |
download | rsyslog-3c1895a699f7d37b49f41f6f758ead4abea0caf2.tar.gz rsyslog-3c1895a699f7d37b49f41f6f758ead4abea0caf2.tar.xz rsyslog-3c1895a699f7d37b49f41f6f758ead4abea0caf2.zip |
bugfix: zero-sized (empty) messages were processed by imtcp
they are now dropped as they always should have been
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | tcps_sess.c | 11 |
2 files changed, 11 insertions, 2 deletions
@@ -1,5 +1,7 @@ --------------------------------------------------------------------------- Version 4.6.4 [v4-stable] (rgerhards), 2010-??-?? +- bugfix: zero-sized (empty) messages were processed by imtcp + they are now dropped as they always should have been --------------------------------------------------------------------------- Version 4.6.3 [v4-stable] (rgerhards), 2010-07-07 - improvded testbench diff --git a/tcps_sess.c b/tcps_sess.c index dec14b5a..ea9032b3 100644 --- a/tcps_sess.c +++ b/tcps_sess.c @@ -238,6 +238,11 @@ defaultDoSubmitMessage(tcps_sess_t *pThis, struct syslogTime *stTime, time_t ttG ISOBJ_TYPE_assert(pThis, tcps_sess); + if(pThis->iMsg == 0) { + DBGPRINTF("discarding zero-sized message\n"); + FINALIZE; + } + if(pThis->DoSubmitMessage != NULL) { pThis->DoSubmitMessage(pThis, pThis->pMsg, pThis->iMsg); FINALIZE; @@ -477,8 +482,10 @@ DataRcvd(tcps_sess_t *pThis, char *pData, size_t iLen) CHKiRet(processDataRcvd(pThis, *pData++, &stTime, ttGenTime, &multiSub)); } - /* submit anything that was not yet submitted */ - CHKiRet(multiSubmitMsg(&multiSub)); + if(multiSub.nElem > 0) { + /* submit anything that was not yet submitted */ + CHKiRet(multiSubmitMsg(&multiSub)); + } finalize_it: RETiRet; |