summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-08-06 20:20:51 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-08-06 20:20:51 +0000
commita7a9e013291754e27e5d074fae5b65cc045ce51b (patch)
treef5f4b925fe24be5b6ba71ec6a132ccf179d17729
parentccf8545f2c53dab155347fbeb1f1079411e44af2 (diff)
downloadrsyslog-a7a9e013291754e27e5d074fae5b65cc045ce51b.tar.gz
rsyslog-a7a9e013291754e27e5d074fae5b65cc045ce51b.tar.xz
rsyslog-a7a9e013291754e27e5d074fae5b65cc045ce51b.zip
applied a patch from varmojfekoj which solved a potential segfault of
rsyslogd on HUP
-rw-r--r--ChangeLog2
-rw-r--r--syslogd.c15
2 files changed, 13 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index c06078da..48e37f04 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
---------------------------------------------------------------------------
Version 1.18.1 (rgerhards), 2007-08-??
+- applied a patch from varmojfekoj which solved a potential segfault
+ of rsyslogd on HUP
---------------------------------------------------------------------------
Version 1.18.0 (rgerhards), 2007-08-03
- rsyslog now supports fallback actions when an action did not work. This
diff --git a/syslogd.c b/syslogd.c
index 928f0e3c..773f0c96 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -5178,7 +5178,8 @@ static rsRetVal selectorAddList(selector_t *f)
DEFiRet;
int iActionCnt;
-static selector_t *nextp = NULL;
+ static selector_t *nextp = NULL; /* TODO: make this go away (see comment below) */
+
if(f != NULL) {
CHKiRet(llGetNumElts(&f->llActList, &iActionCnt));
if(iActionCnt == 0) {
@@ -5192,9 +5193,15 @@ static selector_t *nextp = NULL;
}
/* successfully created an entry */
dprintf("selector line successfully processed\n");
- // TODO: we should use the linked list class for the selector list, else we need to add globals
- // ... well nextp could be added temporarily...
- if(nextp == NULL) {
+ /* TODO: we should use the linked list class for the selector list, else we need to add globals
+ * ... well nextp could be added temporarily...
+ * Thanks to varmojfekoj for having the idea to just use "Files" to make this
+ * code work. I had actually forgotten to fix the code here before moving to 1.18.0.
+ * And, of course, I also did not migrate the selector_t structure to the linked list class.
+ * However, that should still be one of the very next things to happen.
+ * rgerhards, 2007-08-06
+ */
+ if(Files == NULL) {
Files = f;
} else {
nextp->f_next = f;