From 15feb0e16ed05227d92385978ab6fe256d928ca6 Mon Sep 17 00:00:00 2001 From: louis Date: Mon, 21 Mar 2016 22:47:35 +0100 Subject: [PATCH] fixed bad memory access in case an int token is not set --- coreengine/complextypes.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/coreengine/complextypes.c b/coreengine/complextypes.c index a660dca..7c9f77a 100644 --- a/coreengine/complextypes.c +++ b/coreengine/complextypes.c @@ -1220,8 +1220,10 @@ char *cTextExpr::DeterminateText(void) { strcat(retVal, str); } else if (t->type == eTexttokenType::inttoken) { int value = tokenContainer->IntToken(t->tokenIndex); - cString str = cString::sprintf("%d", value); - strcat(retVal, *str); + if (value > 0) { + cString str = cString::sprintf("%d", value); + strcat(retVal, *str); + } } else if (t->type == eTexttokenType::looptoken && loopInfo && loopInfo->row >= 0) { char *str = tokenContainer->LoopToken(loopInfo->index, loopInfo->row, t->tokenIndex); if (str)