diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-07-09 12:25:51 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-07-09 12:25:51 +0200 |
commit | cafb951020817cca6b89b5cc6b91f3a8ab86f29a (patch) | |
tree | e95afa136bad2056c20a63bf9652995669250a1d /template.c | |
parent | 33c5bb3c08d7f826862ff78816be82cbe09d17eb (diff) | |
download | rsyslog-cafb951020817cca6b89b5cc6b91f3a8ab86f29a.tar.gz rsyslog-cafb951020817cca6b89b5cc6b91f3a8ab86f29a.tar.xz rsyslog-cafb951020817cca6b89b5cc6b91f3a8ab86f29a.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.
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); |