diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2012-06-11 18:21:10 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-06-11 18:21:10 +0200 |
commit | 0620fc5780fabdfb160524197fd4aa6bb22613e9 (patch) | |
tree | bda32c65fbe04ab13f9b6ecf3ff98cdc56f83457 /runtime | |
parent | 29cd813960ed8e4f800cb9210d30888368587f1c (diff) | |
parent | 3ebbb9c4bbfe5d4a815861afde28df47d35b022e (diff) | |
download | rsyslog-0620fc5780fabdfb160524197fd4aa6bb22613e9.tar.gz rsyslog-0620fc5780fabdfb160524197fd4aa6bb22613e9.tar.xz rsyslog-0620fc5780fabdfb160524197fd4aa6bb22613e9.zip |
Merge branch 'v5-stable' into v5-beta
Conflicts:
ChangeLog
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/msg.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/runtime/msg.c b/runtime/msg.c index 1b0f2323..01bafb86 100644 --- a/runtime/msg.c +++ b/runtime/msg.c @@ -982,11 +982,15 @@ msg_t* MsgDup(msg_t* pOld) } else { tmpCOPYSZ(RawMsg); } - if(pOld->iLenHOSTNAME < CONF_HOSTNAME_BUFSIZE) { - memcpy(pNew->szHOSTNAME, pOld->szHOSTNAME, pOld->iLenHOSTNAME + 1); - pNew->pszHOSTNAME = pNew->szHOSTNAME; + if(pOld->pszHOSTNAME == NULL) { + pNew->pszHOSTNAME = NULL; } else { - tmpCOPYSZ(HOSTNAME); + if(pOld->iLenHOSTNAME < CONF_HOSTNAME_BUFSIZE) { + memcpy(pNew->szHOSTNAME, pOld->szHOSTNAME, pOld->iLenHOSTNAME + 1); + pNew->pszHOSTNAME = pNew->szHOSTNAME; + } else { + tmpCOPYSZ(HOSTNAME); + } } tmpCOPYCSTR(ProgName); |