core bugfix: string not properly terminated when RFC5424 MSGID is used

this can lead to misadressing when the jsonmesg property is used.

closes https://github.com/rsyslog/rsyslog/issues/2396
This commit is contained in:
Rainer Gerhards 2018-01-17 11:05:14 +01:00
parent 639234201f
commit abe327b08a

View File

@ -2272,7 +2272,8 @@ rsRetVal MsgSetMSGID(smsg_t * const pMsg, const char* pszMSGID)
CHKiRet(rsCStrConstruct(&pMsg->pCSMSGID));
}
/* if we reach this point, we have the object */
iRet = rsCStrSetSzStr(pMsg->pCSMSGID, (uchar*) pszMSGID);
CHKiRet(rsCStrSetSzStr(pMsg->pCSMSGID, (uchar*) pszMSGID));
cstrFinalize(pMsg->pCSMSGID);
finalize_it:
RETiRet;