From 9de685929e4c202d470e07ec28fda41a5efc8eaf Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 9 Jul 2009 16:32:14 +0200 Subject: 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. --- template.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'template.c') diff --git a/template.c b/template.c index 832183b0..0116e782 100644 --- a/template.c +++ b/template.c @@ -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); -- cgit