diff options
author | David Lang <david@lang.hm> | 2011-02-11 07:44:09 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2011-02-11 07:44:09 +0100 |
commit | a9736c6215cf6446c326b034648f63a79c0426f9 (patch) | |
tree | 84512ba38480e5e24c8c49330bbdc09480b4a7e4 /plugins | |
parent | 2c1021a01f75f5bb3e16b7b952a2d29494943bed (diff) | |
download | rsyslog-a9736c6215cf6446c326b034648f63a79c0426f9.tar.gz rsyslog-a9736c6215cf6446c326b034648f63a79c0426f9.tar.xz rsyslog-a9736c6215cf6446c326b034648f63a79c0426f9.zip |
bugfix in pmsnare
when removing text from the message, decrement the length when you increment
the pointer through the message. there were a number of places where this was
missed.
Signed-off-by: Rainer Gerhards <rgerhards@adiscon.com>
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/pmsnare/pmsnare.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/pmsnare/pmsnare.c b/plugins/pmsnare/pmsnare.c index ce2138b2..4a9880d4 100644 --- a/plugins/pmsnare/pmsnare.c +++ b/plugins/pmsnare/pmsnare.c @@ -137,14 +137,17 @@ CODESTARTparse *p2parse = ' '; lenMsg -=(tablength-2); p2parse++; + lenMsg--; memmove(p2parse, p2parse + (tablength-2), lenMsg); *(p2parse + lenMsg) = '\n'; *(p2parse + lenMsg + 1) = '\0'; pMsg->iLenRawMsg -=(tablength-2); pMsg->iLenMSG -=(tablength-2); p2parse += snaremessage; + lenMsg -= snaremessage; *p2parse = ' '; p2parse++; + lenMsg--; lenMsg -=(tablength-2); memmove(p2parse, p2parse + (tablength-2), lenMsg); *(p2parse + lenMsg) = '\n'; @@ -178,8 +181,10 @@ CODESTARTparse } if(snaremessage) { p2parse += snaremessage; + lenMsg -= snaremessage; *p2parse = ' '; p2parse++; + lenMsg--; lenMsg -=(tablength-2); memmove(p2parse, p2parse + (tablength-2), lenMsg); *(p2parse + lenMsg) = '\n'; @@ -190,7 +195,7 @@ CODESTARTparse } } - DBGPRINTF("pmsnare: new mesage: [%d]'%s'\n", lenMsg, pMsg->pszRawMsg + pMsg->offAfterPRI); + DBGPRINTF("pmsnare: new message: [%d]'%s'\n", lenMsg, pMsg->pszRawMsg + pMsg->offAfterPRI); ABORT_FINALIZE(RS_RET_COULD_NOT_PARSE); finalize_it: |