diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2010-12-16 12:02:36 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2010-12-16 12:02:36 +0100 |
commit | 7817aa1597384fce7ac643e56ee56f47d3c5d37d (patch) | |
tree | 3084fe8a0368f3a4602c49c287fa339b7c3daa28 /runtime/conf.c | |
parent | c4026ec0f8d843540d01b07f94d4182d7dddb62e (diff) | |
download | rsyslog-7817aa1597384fce7ac643e56ee56f47d3c5d37d.tar.gz rsyslog-7817aa1597384fce7ac643e56ee56f47d3c5d37d.tar.xz rsyslog-7817aa1597384fce7ac643e56ee56f47d3c5d37d.zip |
bugfix: unitialized variable could cause issues under extreme conditions
plus some minor nits. This was found after a clang static code analyzer
analysis (great tool, and special thanks to Marcin for telling me about
it!)
Diffstat (limited to 'runtime/conf.c')
-rw-r--r-- | runtime/conf.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/runtime/conf.c b/runtime/conf.c index d41f2950..529142ed 100644 --- a/runtime/conf.c +++ b/runtime/conf.c @@ -1084,7 +1084,7 @@ static rsRetVal cflineDoAction(uchar **p, action_t **ppAction) DEFiRet; modInfo_t *pMod; omodStringRequest_t *pOMSR; - action_t *pAction; + action_t *pAction = NULL; void *pModData; ASSERT(p != NULL); @@ -1092,6 +1092,11 @@ static rsRetVal cflineDoAction(uchar **p, action_t **ppAction) /* loop through all modules and see if one picks up the line */ pMod = module.GetNxtType(NULL, eMOD_OUT); + /* Note: clang static analyzer reports that pMod mybe == NULL. However, this is + * not possible, because we have the built-in output modules which are always + * present. Anyhow, we guard this by an assert. -- rgerhards, 2010-12-16 + */ + assert(pMod != NULL); while(pMod != NULL) { pOMSR = NULL; iRet = pMod->mod.om.parseSelectorAct(p, &pModData, &pOMSR); |