From e938d055f427275005d538bf09d3b40e0f680d5f Mon Sep 17 00:00:00 2001
From: Palmer <palmer@lindenlab.com>
Date: Wed, 17 Feb 2010 17:06:36 -0800
Subject: [PATCH] EXT-5309 : prevent infinite loop in LLConsole. Reviewed by
 Richard

---
 indra/llui/llconsole.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp
index a4f69e7ac1b..badbddc3ccd 100644
--- a/indra/llui/llconsole.cpp
+++ b/indra/llui/llconsole.cpp
@@ -300,7 +300,8 @@ void LLConsole::Paragraph::updateLines(F32 screen_width, const LLFontGL* font, b
 	S32 paragraph_offset = 0;			//Offset into the paragraph text.
 
 	// Wrap lines that are longer than the view is wide.
-	while( paragraph_offset < (S32)mParagraphText.length() )
+	while( paragraph_offset < (S32)mParagraphText.length() &&
+		   mParagraphText[paragraph_offset] != 0)
 	{
 		S32 skip_chars; // skip '\n'
 		// Figure out if a word-wrapped line fits here.
-- 
GitLab