mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-15 12:50:41 +01:00
bugfix core: potential segfault in template engine
under some circumstances (not entirely clear right now), memory was freed but later re-used as state-tracking structures were not properly maintained. Github issue mentioned below has full details. Thanks to github user snaix for analysing this issue and providing a patch. I am committing as myself as snaix did not disclose his or her identity. closes https://github.com/rsyslog/rsyslog/issues/3019 closes https://github.com/rsyslog/rsyslog/issues/4040
This commit is contained in:
parent
56b1dd06ae
commit
7852997099
4
action.c
4
action.c
@ -1162,6 +1162,8 @@ releaseDoActionParams(action_t *__restrict__ const pAction, wti_t *__restrict__
|
|||||||
if (ACT_STRING_PASSING == pAction->peParamPassing[j]) {
|
if (ACT_STRING_PASSING == pAction->peParamPassing[j]) {
|
||||||
free(pWrkrInfo->p.nontx.actParams[j].param);
|
free(pWrkrInfo->p.nontx.actParams[j].param);
|
||||||
pWrkrInfo->p.nontx.actParams[j].param = NULL;
|
pWrkrInfo->p.nontx.actParams[j].param = NULL;
|
||||||
|
pWrkrInfo->p.nontx.actParams[j].lenBuf = 0;
|
||||||
|
pWrkrInfo->p.nontx.actParams[j].lenStr = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch(pAction->peParamPassing[j]) {
|
switch(pAction->peParamPassing[j]) {
|
||||||
@ -1173,6 +1175,8 @@ releaseDoActionParams(action_t *__restrict__ const pAction, wti_t *__restrict__
|
|||||||
json_object_put((struct json_object*)
|
json_object_put((struct json_object*)
|
||||||
pWrkrInfo->p.nontx.actParams[j].param);
|
pWrkrInfo->p.nontx.actParams[j].param);
|
||||||
pWrkrInfo->p.nontx.actParams[j].param = NULL;
|
pWrkrInfo->p.nontx.actParams[j].param = NULL;
|
||||||
|
pWrkrInfo->p.nontx.actParams[j].lenBuf = 0;
|
||||||
|
pWrkrInfo->p.nontx.actParams[j].lenStr = 0;
|
||||||
break;
|
break;
|
||||||
case ACT_STRING_PASSING:
|
case ACT_STRING_PASSING:
|
||||||
case ACT_MSG_PASSING:
|
case ACT_MSG_PASSING:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user