diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-07-09 16:32:14 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-07-09 16:32:14 +0200 |
commit | 9de685929e4c202d470e07ec28fda41a5efc8eaf (patch) | |
tree | d64599ac8dee82c96cebb641af24d04befd98f63 /template.c | |
parent | 92020c6ea15215af1ea361c8fe010b604653b8f7 (diff) | |
download | rsyslog-9de685929e4c202d470e07ec28fda41a5efc8eaf.tar.gz rsyslog-9de685929e4c202d470e07ec28fda41a5efc8eaf.tar.xz rsyslog-9de685929e4c202d470e07ec28fda41a5efc8eaf.zip |
bugfix: message could be truncated after TAG, often when forwarding
This was a result of an internal processing error if maximum field
sizes had been specified in the property replacer.
Also did some testbench improvements, including omstdout.
Diffstat (limited to 'template.c')
-rw-r--r-- | template.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -121,8 +121,10 @@ rsRetVal tplToString(struct template *pTpl, msg_t *pMsg, uchar **ppBuf, size_t * if(iBuf + iLenVal + 1 >= *pLenBuf) /* we reserve one char for the final \0! */ CHKiRet(ExtendBuf(ppBuf, pLenBuf, iBuf + iLenVal + 1)); - memcpy(*ppBuf + iBuf, pVal, iLenVal); - iBuf += iLenVal; + if(iLenVal > 0) { /* may be zero depending on property */ + memcpy(*ppBuf + iBuf, pVal, iLenVal); + iBuf += iLenVal; + } if(bMustBeFreed) free(pVal); |