From 230883321cfa7e2dea6d4e5bffe5c3a6b00883ba Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 12 Mar 2008 08:07:30 +0000 Subject: - bugfix: not properly initialized data could cause several segfaults if there were errors in the config file - thanks to varmojfekoj for the patch --- ChangeLog | 2 ++ module-template.h | 2 +- omfile.c | 5 +++-- syslogd.c | 1 + 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) { -- cgit v1.2.3