summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-08-17 16:17:36 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-08-17 16:17:36 (GMT)
commit02f98ddbe9d49ff67af5364699bc0ca8daaad8ca (patch)
tree12f06c3b21c50f9e023ac4bf98c141ee894eb660 /src
parent21f050800b450ce5adfbac8ac5466e38881cabf6 (diff)
downloadpowder-02f98ddbe9d49ff67af5364699bc0ca8daaad8ca.zip
powder-02f98ddbe9d49ff67af5364699bc0ca8daaad8ca.tar.gz
Ensure input text is null terminated when parsing RichText
Diffstat (limited to 'src')
-rw-r--r--src/interface/RichLabel.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/interface/RichLabel.cpp b/src/interface/RichLabel.cpp
index 01d35fc..c93e217 100644
--- a/src/interface/RichLabel.cpp
+++ b/src/interface/RichLabel.cpp
@@ -39,7 +39,7 @@ void RichLabel::updateRichText()
displayText = "";
if(textSource.length())
- {
+ {
enum State { ReadText, ReadData, ReadRegion, ReadDataStart };
State state = ReadText;
@@ -55,6 +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;
int stackPos = -1;
RichTextRegion * regionsStack = new RichTextRegion[256];