summaryrefslogtreecommitdiffstats
path: root/runtime/conf.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-09-02 11:38:31 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-09-02 11:38:31 +0200
commit1a9ac0ced72dd163228438af4f31f233fab20529 (patch)
tree6f228f58615d596bef9ca4f3f0da934368191369 /runtime/conf.c
parentc2f30a2fc3fb1f87c157828dd08ee20fe444833d (diff)
downloadrsyslog-1a9ac0ced72dd163228438af4f31f233fab20529.tar.gz
rsyslog-1a9ac0ced72dd163228438af4f31f233fab20529.tar.xz
rsyslog-1a9ac0ced72dd163228438af4f31f233fab20529.zip
removed compile time fixed message size limit (was 2K)
The limit can now be set via $MaxMessageSize global config directive (finally gotten rid of MAXLINE ;))
Diffstat (limited to 'runtime/conf.c')
-rw-r--r--runtime/conf.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/runtime/conf.c b/runtime/conf.c
index ffe67dbe..e55b8d18 100644
--- a/runtime/conf.c
+++ b/runtime/conf.c
@@ -570,8 +570,7 @@ cflineParseFileName(uchar* p, uchar *pFileName, omodStringRequest_t *pOMSR, int
}
-/*
- * Helper to cfline(). This function takes the filter part of a traditional, PRI
+/* Helper to cfline(). This function takes the filter part of a traditional, PRI
* based line and decodes the PRIs given in the selector line. It processed the
* line up to the beginning of the action part. A pointer to that beginnig is
* passed back to the caller.
@@ -587,8 +586,9 @@ static rsRetVal cflineProcessTradPRIFilter(uchar **pline, register selector_t *f
int pri;
int singlpri = 0;
int ignorepri = 0;
- uchar buf[MAXLINE];
+ uchar buf[2048]; /* buffer for facility and priority names */
uchar xbuf[200];
+ DEFiRet;
ASSERT(pline != NULL);
ASSERT(*pline != NULL);
@@ -613,7 +613,7 @@ static rsRetVal cflineProcessTradPRIFilter(uchar **pline, register selector_t *f
continue;
/* collect priority name */
- for (bp = buf; *q && !strchr("\t ,;", *q); )
+ for (bp = buf; *q && !strchr("\t ,;", *q) && bp < buf+sizeof(buf)-1 ; )
*bp++ = *q++;
*bp = '\0';
@@ -624,6 +624,7 @@ static rsRetVal cflineProcessTradPRIFilter(uchar **pline, register selector_t *f
/* decode priority name */
if ( *buf == '!' ) {
ignorepri = 1;
+ /* copy below is ok, we can NOT go off the allocated area */
for (bp=buf; *(bp+1); bp++)
*bp=*(bp+1);
*bp='\0';
@@ -649,7 +650,7 @@ static rsRetVal cflineProcessTradPRIFilter(uchar **pline, register selector_t *f
/* scan facilities */
while (*p && !strchr("\t .;", *p)) {
- for (bp = buf; *p && !strchr("\t ,;.", *p); )
+ for (bp = buf; *p && !strchr("\t ,;.", *p) && bp < buf+sizeof(buf)-1 ; )
*bp++ = *p++;
*bp = '\0';
if (*buf == '*') {
@@ -732,7 +733,7 @@ static rsRetVal cflineProcessTradPRIFilter(uchar **pline, register selector_t *f
p++;
*pline = p;
- return RS_RET_OK;
+ RETiRet;
}