summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--parse.c2
-rw-r--r--runtime/stringbuf.c4
3 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 0d948b3e..077e2b6f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -36,6 +36,11 @@ Version 7.2.2 [v7-stable] 2012-10-??
truncated field names or including extra random data. If the random data
contained NULs, the rest of the message became unreadable.
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=374
+- bugfix: potential segfault at startup with property-based filter
+ If the property name was followed by a space before the comma, rsyslogd
+ aborted on startup. Note that no segfault could happen if the initial
+ startup went well (this was a problem with the config parser).
+ closes: http://bugzilla.adiscon.com/show_bug.cgi?id=381
----------------------------------------------------------------------------
Version 7.2.1 [v7-stable] 2012-10-29
- bugfix: ruleset()-object did only support a single statement
diff --git a/parse.c b/parse.c
index 2d89030e..097e7470 100644
--- a/parse.c
+++ b/parse.c
@@ -262,7 +262,7 @@ rsRetVal parsDelimCStr(rsParsObj *pThis, cstr_t **ppCStr, char cDelim, int bTrim
pC = rsCStrGetBufBeg(pThis->pCStr) + pThis->iCurrPos;
- while(pThis->iCurrPos < rsCStrLen(pThis->pCStr) && *pC != cDelim && *pC != ' ') {
+ while(pThis->iCurrPos < rsCStrLen(pThis->pCStr) && *pC != cDelim) {
CHKiRet(cstrAppendChar(pCStr, bConvLower ? tolower(*pC) : *pC));
++pThis->iCurrPos;
++pC;
diff --git a/runtime/stringbuf.c b/runtime/stringbuf.c
index e7fd72c2..5bca009d 100644
--- a/runtime/stringbuf.c
+++ b/runtime/stringbuf.c
@@ -482,6 +482,8 @@ rsRetVal cstrTrimTrailingWhiteSpace(cstr_t *pThis)
register uchar *pC;
rsCHECKVALIDOBJECT(pThis, OIDrsCStr);
+ if(pThis->iStrLen == 0)
+ goto done; /* empty string -> nothing to trim ;) */
i = pThis->iStrLen;
pC = pThis->pBuf + i - 1;
while(i > 0 && isspace((int)*pC)) {
@@ -492,7 +494,7 @@ rsRetVal cstrTrimTrailingWhiteSpace(cstr_t *pThis)
pThis->iStrLen = i;
pThis->pBuf[pThis->iStrLen] = '0'; /* we always have this space */
- return RS_RET_OK;
+done: return RS_RET_OK;
}
/* compare two string objects - works like strcmp(), but operates