summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2010-01-27 09:52:15 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2010-01-27 09:52:15 +0100
commit074ec9495e9f07f7ff441a60f756b0d15931a8d7 (patch)
tree64a9d7bc56ed09bcf496b6bbb40f9a87c4eb3472
parent7f4972b9fa132c7e5c8077f58e3e2845326884af (diff)
downloadrsyslog-074ec9495e9f07f7ff441a60f756b0d15931a8d7.tar.gz
rsyslog-074ec9495e9f07f7ff441a60f756b0d15931a8d7.tar.xz
rsyslog-074ec9495e9f07f7ff441a60f756b0d15931a8d7.zip
backporting bugfixes from 5.2.2
- bugfix: queues in direct mode could case a segfault, especially if an action failed for action queues. The issue was an invalid increment of a stack-based pointer which lead to destruction of the stack frame and thus a segfault on function return. Thanks to Michael Biebl for alerting us on this problem. [backport from 5.5.2] - bugfix: wrong memory assignment for a config variable (probably without causing any harm) [backport from 5.2.2]
-rw-r--r--ChangeLog8
-rw-r--r--action.c4
-rw-r--r--tools/syslogd.c2
3 files changed, 11 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index c741e069..9c54b06f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
---------------------------------------------------------------------------
Version 5.3.7 [BETA] (rgerhards), 2010-01-??
+- bugfix: queues in direct mode could case a segfault, especially if an
+ action failed for action queues. The issue was an invalid increment of
+ a stack-based pointer which lead to destruction of the stack frame and
+ thus a segfault on function return.
+ Thanks to Michael Biebl for alerting us on this problem.
+ [backport from 5.5.2]
+- bugfix: wrong memory assignment for a config variable (probably
+ without causing any harm) [backport from 5.2.2]
- bugfix: potential segfaults during queue shutdown
(bugs require certain non-standard settings to appear)
Thanks to varmojfekoj for the patch [imported from 4.5.8]
diff --git a/action.c b/action.c
index 67858742..aaf45593 100644
--- a/action.c
+++ b/action.c
@@ -924,12 +924,12 @@ submitBatch(action_t *pAction, batch_t *pBatch, int nElem, int *pbShutdownImmedi
} else if(localRet == RS_RET_ACTION_FAILED) {
/* in this case, the whole batch can not be processed */
for(i = 0 ; i < nElem ; ++i) {
- pBatch->pElem[++pBatch->iDoneUpTo].state = BATCH_STATE_BAD;
+ pBatch->pElem[pBatch->iDoneUpTo++].state = BATCH_STATE_BAD;
}
bDone = 1;
} else {
if(nElem == 1) {
- pBatch->pElem[++pBatch->iDoneUpTo].state = BATCH_STATE_BAD;
+ pBatch->pElem[pBatch->iDoneUpTo++].state = BATCH_STATE_BAD;
bDone = 1;
} else {
/* retry with half as much. Depth is log_2 batchsize, so recursion is not too deep */
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 21df6d6c..0f7325fc 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -280,7 +280,7 @@ static int iMainMsgQtoWrkShutdown = 60000; /* timeout for worker thread shutdo
static int iMainMsgQWrkMinMsgs = 100; /* minimum messages per worker needed to start a new one */
static int iMainMsgQDeqSlowdown = 0; /* dequeue slowdown (simple rate limiting) */
static int64 iMainMsgQueMaxDiskSpace = 0; /* max disk space allocated 0 ==> unlimited */
-static int iMainMsgQueDeqBatchSize = 32; /* dequeue batch size */
+static int64 iMainMsgQueDeqBatchSize = 32; /* dequeue batch size */
static int bMainMsgQSaveOnShutdown = 1; /* save queue on shutdown (when DA enabled)? */
static int iMainMsgQueueDeqtWinFromHr = 0; /* hour begin of time frame when queue is to be dequeued */
static int iMainMsgQueueDeqtWinToHr = 25; /* hour begin of time frame when queue is to be dequeued */