From 305c74d5163c5e344a675d39ca2394a9e45bd2c2 Mon Sep 17 00:00:00 2001 From: Aaron Brashears Date: Fri, 2 Feb 2007 17:28:58 +0000 Subject: Result of svn merge -r57264:57370 svn+ssh://svn/svn/linden/branches/adroit.r40-68 into release. --- indra/llui/lltexteditor.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'indra/llui/lltexteditor.cpp') diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index a4747aef67..710e333796 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -3763,7 +3763,7 @@ BOOL LLTextEditor::importBuffer(const LLString& buffer ) // (text may contain ext_char_values) // }\n - char tbuf[MAX_STRING]; + char tbuf[MAX_STRING]; /* Flawfinder: ignore */ S32 version = 0; instream.getline(tbuf, MAX_STRING); @@ -3803,11 +3803,16 @@ BOOL LLTextEditor::importBuffer(const LLString& buffer ) BOOL success = TRUE; char* text = new char[ text_len + 1]; + if (text == NULL) + { + llerrs << "Memory allocation failure." << llendl; + return FALSE; + } instream.get(text, text_len + 1, '\0'); text[text_len] = '\0'; - if( text_len != (S32)strlen(text) ) + if( text_len != (S32)strlen(text) )/* Flawfinder: ignore */ { - llwarns << llformat("Invalid text length: %d != %d ",strlen(text),text_len) << llendl; + llwarns << llformat("Invalid text length: %d != %d ",strlen(text),text_len) << llendl;/* Flawfinder: ignore */ success = FALSE; } -- cgit v1.2.3