summaryrefslogtreecommitdiffstats
path: root/runtime/msg.c
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/msg.c')
-rw-r--r--runtime/msg.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/runtime/msg.c b/runtime/msg.c
index 09f6d649..10605ba4 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -3027,6 +3027,8 @@ uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe,
*/
; /*DO NOTHING*/
} else {
+ if(iTo > bufLen) /* iTo is very large, if no to-position is set in the template! */
+ iTo = bufLen;
iLen = iTo - iFrom + 1; /* the +1 is for an actual char, NOT \0! */
pBufStart = pBuf = MALLOC((iLen + 1) * sizeof(char));
if(pBuf == NULL) {