summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-03-12 08:07:30 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-03-12 08:07:30 +0000
commit230883321cfa7e2dea6d4e5bffe5c3a6b00883ba (patch)
tree6552d04cd3a221a9d2e731fb7a0b0a3c146ffa31
parentb00cf838bb11fdff8a55c67f07e1045350ec8981 (diff)
downloadrsyslog-230883321cfa7e2dea6d4e5bffe5c3a6b00883ba.tar.gz
rsyslog-230883321cfa7e2dea6d4e5bffe5c3a6b00883ba.tar.xz
rsyslog-230883321cfa7e2dea6d4e5bffe5c3a6b00883ba.zip
- bugfix: not properly initialized data could cause several segfaults if
there were errors in the config file - thanks to varmojfekoj for the patch
-rw-r--r--ChangeLog2
-rw-r--r--module-template.h2
-rw-r--r--omfile.c5
-rw-r--r--syslogd.c1
4 files changed, 7 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 1caea15b..a8b562cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,8 @@ Version 2.0.3 STABLE (rgerhards), 2008-02-??
unlikely to happen in practice), for details see tracker:
http://bugzilla.adiscon.com/show_bug.cgi?id=38
- improved the man pages a bit - thanks to Michael Biebl for the patch
+- bugfix: not properly initialized data could cause several segfaults if
+ there were errors in the config file - thanks to varmojfekoj for the patch
---------------------------------------------------------------------------
Version 2.0.2 STABLE (rgerhards), 2008-02-12
- fixed a bug that could cause invalid string handling via strerror_r
diff --git a/module-template.h b/module-template.h
index 13ae4b86..a5ece4fb 100644
--- a/module-template.h
+++ b/module-template.h
@@ -260,7 +260,7 @@ finalize_it:\
*ppOMSR = NULL;\
}\
if(pData != NULL)\
- freeInstance(&pData);\
+ freeInstance(pData);\
}
#define ENDparseSelectorAct \
diff --git a/omfile.c b/omfile.c
index cd5e23c4..db2ec3eb 100644
--- a/omfile.c
+++ b/omfile.c
@@ -344,7 +344,8 @@ static void dynaFileFreeCache(instanceData *pData)
dynaFileDelCacheEntry(pData->dynCache, i, 1);
}
- free(pData->dynCache);
+ if(pData->dynCache != NULL)
+ free(pData->dynCache);
}
@@ -605,7 +606,7 @@ BEGINfreeInstance
CODESTARTfreeInstance
if(pData->bDynamicName) {
dynaFileFreeCache(pData);
- } else
+ } else if(pData->fd != -1)
close(pData->fd);
ENDfreeInstance
diff --git a/syslogd.c b/syslogd.c
index e03ff05e..06780bf9 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -5220,6 +5220,7 @@ static rsRetVal cflineDoAction(uchar **p, action_t **ppAction)
/* loop through all modules and see if one picks up the line */
pMod = omodGetNxt(NULL);
while(pMod != NULL) {
+ pOMSR = NULL;
iRet = pMod->mod.om.parseSelectorAct(p, &pModData, &pOMSR);
dbgprintf("tried selector action for %s: %d\n", modGetName(pMod), iRet);
if(iRet == RS_RET_OK || iRet == RS_RET_SUSPENDED) {