From a9cce88be619c2296080b3eaa896595dac80d452 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Fri, 17 Aug 2012 23:16:55 +0100 Subject: [PATCH] Fix crash when creating null terminator in updateRichText (writing out of bounds) --- src/interface/RichLabel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interface/RichLabel.cpp b/src/interface/RichLabel.cpp index c93e2172b..84dc50004 100644 --- a/src/interface/RichLabel.cpp +++ b/src/interface/RichLabel.cpp @@ -55,7 +55,7 @@ void RichLabel::updateRichText() int originalTextPos = 0; char * originalText = new char[textSource.length()+1]; std::copy(textSource.begin(), textSource.end(), originalText); - originalText[textSource.length()+1] = 0; + originalText[textSource.length()] = 0; int stackPos = -1; RichTextRegion * regionsStack = new RichTextRegion[256];