From b01c75cb423f07a3d3354f8bd62f265f80062b3b Mon Sep 17 00:00:00 2001 From: Adam Moss Date: Thu, 16 Apr 2009 23:45:35 +0000 Subject: svn merge -r117314:117337 svn+ssh://svn.lindenlab.com/svn/linden/branches/moss/mv13a-merge-1 QAR-1343 maint-viewer-13a+libcurlexploitfix-3-3 combo merge --- indra/newview/llfloaterregioninfo.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 588df7b43b..2b418b4caa 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -2862,20 +2862,14 @@ void LLPanelEstateCovenant::onLoadComplete(LLVFS *vfs, S32 file_length = file.getSize(); - char* buffer = new char[file_length+1]; - if (buffer == NULL) - { - llerrs << "Memory Allocation Failed" << llendl; - return; - } - - file.read((U8*)buffer, file_length); /* Flawfinder: ignore */ + std::vector buffer(file_length+1); + file.read((U8*)&buffer[0], file_length); // put a EOS at the end buffer[file_length] = 0; - if( (file_length > 19) && !strncmp( buffer, "Linden text version", 19 ) ) + if( (file_length > 19) && !strncmp( &buffer[0], "Linden text version", 19 ) ) { - if( !panelp->mEditor->importBuffer( buffer, file_length+1 ) ) + if( !panelp->mEditor->importBuffer( &buffer[0], file_length+1 ) ) { llwarns << "Problem importing estate covenant." << llendl; LLNotifications::instance().add("ProblemImportingEstateCovenant"); @@ -2890,7 +2884,6 @@ void LLPanelEstateCovenant::onLoadComplete(LLVFS *vfs, // Version 0 (just text, doesn't include version number) panelp->sendChangeCovenantID(asset_uuid); } - delete[] buffer; } else { -- cgit v1.2.3