Ensure input text is null terminated when parsing RichText

This commit is contained in:
Simon Robertshaw
2012-08-17 17:17:36 +01:00
parent 21f050800b
commit 02f98ddbe9

View File

@@ -55,6 +55,7 @@ void RichLabel::updateRichText()
int originalTextPos = 0; int originalTextPos = 0;
char * originalText = new char[textSource.length()+1]; char * originalText = new char[textSource.length()+1];
std::copy(textSource.begin(), textSource.end(), originalText); std::copy(textSource.begin(), textSource.end(), originalText);
originalText[textSource.length()+1] = 0;
int stackPos = -1; int stackPos = -1;
RichTextRegion * regionsStack = new RichTextRegion[256]; RichTextRegion * regionsStack = new RichTextRegion[256];