summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-03-28 14:18:40 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-03-28 14:18:40 +0000
commitf94cd60dac39fdedbf058b2c97dbf535e54faecf (patch)
treea66a2a4425783668b5b39e195d16c99223405478
parentf574400bb5d18306f3929170d5f4c165ea2b24f9 (diff)
downloadrsyslog-f94cd60dac39fdedbf058b2c97dbf535e54faecf.tar.gz
rsyslog-f94cd60dac39fdedbf058b2c97dbf535e54faecf.tar.xz
rsyslog-f94cd60dac39fdedbf058b2c97dbf535e54faecf.zip
- bugfix: regular expressions inside property replacer did not work
properly
-rw-r--r--ChangeLog14
-rw-r--r--msg.c11
2 files changed, 13 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index dbc86b2b..a21da550 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,14 +1,8 @@
---------------------------------------------------------------------------
Version 3.12.5 (rgerhards), 2008-03-28
-- bugfix: QHOUR and HHOUR properties were wrongly calculated
-- bugfix: fixed memory leaks in stream class and imfile
-- bugfix: $ModDir did invalid bounds checking, potential overlow in
- dbgprintf() - thanks to varmojfekoj for the patch
- changed default for "last message repeated n times", which is now
off by default
- implemented backward compatibility commandline option parsing
-- bugfix: -t and -g legacy options max number of sessions had a wrong
- and much too high value
- automatically generated compatibility config lines are now also
logged so that a user can diagnose problems with them
- added compatibility mode for -a, -o and -p options
@@ -23,6 +17,14 @@ Version 3.12.5 (rgerhards), 2008-03-28
- added build-in templates for easier configuration
- bugfix: fixed small memory leak in tcpclt.c
- bugfix: fixed small memory leak in template regular expressions
+- bugfix: regular expressions inside property replacer did not work
+ properly
+- bugfix: QHOUR and HHOUR properties were wrongly calculated
+- bugfix: fixed memory leaks in stream class and imfile
+- bugfix: $ModDir did invalid bounds checking, potential overlow in
+ dbgprintf() - thanks to varmojfekoj for the patch
+- bugfix: -t and -g legacy options max number of sessions had a wrong
+ and much too high value
---------------------------------------------------------------------------
Version 3.12.4 (rgerhards), 2008-03-25
- Greatly enhanced rsyslogd's file write performance by disabling
diff --git a/msg.c b/msg.c
index 0875cd50..0dd8f416 100644
--- a/msg.c
+++ b/msg.c
@@ -1572,8 +1572,8 @@ char *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe,
#ifdef FEATURE_REGEXP
/* Variables necessary for regular expression matching */
- size_t nmatch = 2;
- regmatch_t pmatch[2];
+ size_t nmatch = 1;
+ regmatch_t pmatch[1];
#endif
assert(pMsg != NULL);
@@ -1807,8 +1807,7 @@ char *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe,
dbgprintf("debug: String to match for regex is: %s\n", pRes);
if(objUse(regexp, LM_REGEXP_FILENAME) == RS_RET_OK) {
- if (0 != regexp.regexec(&pTpe->data.field.re, pRes, nmatch,
- pmatch, 0)) {
+ if (0 != regexp.regexec(&pTpe->data.field.re, pRes, nmatch, pmatch, 0)) {
/* we got no match! */
if (*pbMustBeFreed == 1) {
free(pRes);
@@ -1821,7 +1820,7 @@ char *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe,
int iLenBuf;
char *pB;
- iLenBuf = pmatch[1].rm_eo - pmatch[1].rm_so;
+ iLenBuf = pmatch[0].rm_eo - pmatch[0].rm_so;
pB = (char *) malloc((iLenBuf + 1) * sizeof(char));
if (pB == NULL) {
@@ -1832,7 +1831,7 @@ char *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe,
}
/* Lets copy the matched substring to the buffer */
- memcpy(pB, pRes + pmatch[1].rm_so, iLenBuf);
+ memcpy(pB, pRes + pmatch[0].rm_so, iLenBuf);
pB[iLenBuf] = '\0';/* terminate string, did not happen before */
if (*pbMustBeFreed == 1)