From 1e4963f7fb25763c8ec9b9edc4c5ffdd6a0c5409 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 28 Mar 2008 15:33:34 +0000 Subject: bugfix: regular expressions inside property replacer did not work properly --- ChangeLog | 4 ++++ configure.ac | 2 +- msg.c | 8 ++++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9fe0de67..8feac649 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,8 @@ --------------------------------------------------------------------------- +Version 2.0.5 STABLE (rgerhards), 2008-??-?? +- bugfix: regular expressions inside property replacer did not work + properly +--------------------------------------------------------------------------- Version 2.0.4 STABLE (rgerhards), 2008-03-27 - bugfix: internally generated messages had "FROMHOST" property not set - bugfix: continue parsing if tag is oversize (discard oversize part) - thanks diff --git a/configure.ac b/configure.ac index 881d4179..6163078f 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) -AC_INIT([rsyslog],[2.0.4],[rsyslog@lists.adiscon.com.]) +AC_INIT([rsyslog],[2.0.5],[rsyslog@lists.adiscon.com.]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([syslogd.c]) AC_CONFIG_HEADERS([config.h]) diff --git a/msg.c b/msg.c index fa3e747f..3473495c 100644 --- a/msg.c +++ b/msg.c @@ -1336,8 +1336,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); @@ -1582,7 +1582,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) { @@ -1593,7 +1593,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) -- cgit v1.2.3