summaryrefslogtreecommitdiffstats
path: root/msg.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-09-07 15:21:14 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-09-07 15:21:14 +0000
commitde23e3ef8ce50975077b39de45076262696639d7 (patch)
tree4054de71249e5238097de7bbb340982505b689ab /msg.c
parentde5f0db0add0201e03ca82c576c99bae096bd78a (diff)
downloadrsyslog-de23e3ef8ce50975077b39de45076262696639d7.tar.gz
rsyslog-de23e3ef8ce50975077b39de45076262696639d7.tar.xz
rsyslog-de23e3ef8ce50975077b39de45076262696639d7.zip
applied patch by varmojfekoj two fix two potential segfault situations
Diffstat (limited to 'msg.c')
-rw-r--r--msg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/msg.c b/msg.c
index 1837e58c..eaa11739 100644
--- a/msg.c
+++ b/msg.c
@@ -1663,7 +1663,7 @@ char *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe,
if(pTpe->data.field.options.bDropLastLF && !pTpe->data.field.options.bEscapeCC) {
int iLn = strlen(pRes);
char *pB;
- if(*(pRes + iLn - 1) == '\n') {
+ if(iLn > 0 && *(pRes + iLn - 1) == '\n') {
/* we have a LF! */
/* check if we need to obtain a private copy */
if(*pbMustBeFreed == 0) {