summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVlad Grigorescu <grigorescu@gmail.com>2011-10-17 13:03:52 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2011-10-17 13:03:52 +0200
commite2836f5f430e63bd96502cca74dbc302938e5a23 (patch)
tree09c6a12cb9c89a93788a3b455ab9e563fcafb243
parentcd5253fa82fdbd7529f76c9cec2130e1ccb210bb (diff)
downloadrsyslog-e2836f5f430e63bd96502cca74dbc302938e5a23.tar.gz
rsyslog-e2836f5f430e63bd96502cca74dbc302938e5a23.tar.xz
rsyslog-e2836f5f430e63bd96502cca74dbc302938e5a23.zip
bugfix: ActionQueue could malfunction due to index error
Signed-off-by: Rainer Gerhards <rgerhards@adiscon.com>
-rw-r--r--ChangeLog2
-rw-r--r--action.c18
2 files changed, 11 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index b89429f6..aa0ff579 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
---------------------------------------------------------------------------
Version 5.8.6 [V5-stable] (rgerhards/al), 2011-??-??
+- bugfix: ActionQueue could malfunction due to index error
+ Thanks to Vlad Grigorescu for the patch
- bugfix: imuxsock did no longer ignore message-provided timestamp, if
so configured (the *default*). Lead to no longer sub-second timestamps.
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=281
diff --git a/action.c b/action.c
index 951b4724..633b2664 100644
--- a/action.c
+++ b/action.c
@@ -767,7 +767,7 @@ finalize_it:
*/
static rsRetVal releaseBatch(action_t *pAction, batch_t *pBatch)
{
- int iArr;
+ int jArr;
int i, j;
batch_obj_t *pElem;
uchar ***ppMsgs;
@@ -781,15 +781,15 @@ static rsRetVal releaseBatch(action_t *pAction, batch_t *pBatch)
switch(pAction->eParamPassing) {
case ACT_ARRAY_PASSING:
ppMsgs = (uchar***) pElem->staticActParams;
- for(i = 0 ; i < pAction->iNumTpls ; ++i) {
- if(((uchar**)ppMsgs)[i] != NULL) {
- iArr = 0;
- while(ppMsgs[i][iArr] != NULL) {
- d_free(ppMsgs[i][iArr++]);
- ppMsgs[i][iArr++] = NULL;
+ for(j = 0 ; j < pAction->iNumTpls ; ++j) {
+ if(((uchar**)ppMsgs)[j] != NULL) {
+ jArr = 0;
+ while(ppMsgs[j][jArr] != NULL) {
+ d_free(ppMsgs[j][jArr++]);
+ ppMsgs[j][jArr++] = NULL;
}
- d_free(((uchar**)ppMsgs)[i]);
- ((uchar**)ppMsgs)[i] = NULL;
+ d_free(((uchar**)ppMsgs)[j]);
+ ((uchar**)ppMsgs)[j] = NULL;
}
}
break;