From b835861519f5a636e040cde209d090468dd0517b Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Fri, 17 Aug 2012 16:38:06 +0100 Subject: [PATCH] Some more safety for RichText parser --- src/interface/RichLabel.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/interface/RichLabel.cpp b/src/interface/RichLabel.cpp index 894cf9eb3..3ee12ce00 100644 --- a/src/interface/RichLabel.cpp +++ b/src/interface/RichLabel.cpp @@ -127,6 +127,10 @@ void RichLabel::updateRichText() originalTextPos++; } + + if(stackPos != -1) + throw RichTextParseException("Unclosed region"); + finalText[finalTextPos] = 0; displayText = std::string(finalText); }