From a7a9e013291754e27e5d074fae5b65cc045ce51b Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 6 Aug 2007 20:20:51 +0000 Subject: applied a patch from varmojfekoj which solved a potential segfault of rsyslogd on HUP --- ChangeLog | 2 ++ syslogd.c | 15 +++++++++++---- 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; -- cgit v1.2.3