From eeb30616f601a8e75403d7eb8ffed272a5915a17 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 13:26:05 -0800 Subject: CID-99 Checker: INVALIDATE_ITERATOR Function: LLAllocatorHeapProfile::parse(const std::basic_string, std::allocator>&) File: /indra/llcommon/llallocator_heap_profile.cpp not a bug, but make it clearer to coverity. --- indra/llcommon/llallocator_heap_profile.cpp | 31 ++++++++++++++++------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llallocator_heap_profile.cpp b/indra/llcommon/llallocator_heap_profile.cpp index 0a807702d0..d01b33c8c4 100644 --- a/indra/llcommon/llallocator_heap_profile.cpp +++ b/indra/llcommon/llallocator_heap_profile.cpp @@ -113,20 +113,23 @@ void LLAllocatorHeapProfile::parse(std::string const & prof_text) ++j; while(j != line_elems.end() && j->empty()) { ++j; } // skip any separator tokens - llassert_always(j != line_elems.end()); - ++j; // skip the '@' - - mLines.push_back(line(live_count, live_size, tot_count, tot_size)); - line & current_line = mLines.back(); - - for(; j != line_elems.end(); ++j) - { - if(!j->empty()) { - U32 marker = boost::lexical_cast(*j); - current_line.mTrace.push_back(marker); - } - } - } + llassert(j != line_elems.end()); + if (j != line_elems.end()) + { + ++j; // skip the '@' + + mLines.push_back(line(live_count, live_size, tot_count, tot_size)); + line & current_line = mLines.back(); + + for(; j != line_elems.end(); ++j) + { + if(!j->empty()) + { + U32 marker = boost::lexical_cast(*j); + current_line.mTrace.push_back(marker); + } + } + } // *TODO - parse MAPPED_LIBRARIES section here if we're ever interested in it } -- cgit v1.2.3 From 3616ed1e996f276b3ad195e1f2c9b2f87a5b1455 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 13:28:13 -0800 Subject: sigh, follow-up fix. --- indra/llcommon/llallocator_heap_profile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llallocator_heap_profile.cpp b/indra/llcommon/llallocator_heap_profile.cpp index d01b33c8c4..e50d59fd4b 100644 --- a/indra/llcommon/llallocator_heap_profile.cpp +++ b/indra/llcommon/llallocator_heap_profile.cpp @@ -130,7 +130,7 @@ void LLAllocatorHeapProfile::parse(std::string const & prof_text) } } } - + } // *TODO - parse MAPPED_LIBRARIES section here if we're ever interested in it } -- cgit v1.2.3 From 635290cc8774f0db67d2ee633d287ecf7d767907 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 15:09:25 -0800 Subject: CID-186 Checker: RESOURCE_LEAK Function: LLStringUtilBase::addCRLF(std::basic_string, std::allocator>&) File: /indra/llcommon/llstring.h --- indra/llcommon/llstring.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index 31e70e0fe4..62cedcde4e 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -882,6 +882,7 @@ void LLStringUtilBase::addCRLF(std::basic_string& string) } string.assign(t, size); + delete[] t; } } -- cgit v1.2.3 From 43218577740fa97a99160008568e6e0a36f892e5 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 15:37:28 -0800 Subject: CID-220 Checker: STREAM_FORMAT_STATE Function: encode_character(std::basic_ostream>&, char) File: /indra/llcommon/lluri.cpp --- indra/llcommon/lluri.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/lluri.cpp b/indra/llcommon/lluri.cpp index f6e8f01f0e..9d4f3a98f0 100644 --- a/indra/llcommon/lluri.cpp +++ b/indra/llcommon/lluri.cpp @@ -46,10 +46,21 @@ void encode_character(std::ostream& ostr, std::string::value_type val) { - ostr << "%" << std::uppercase << std::hex << std::setw(2) << std::setfill('0') + ostr << "%" + + << std::uppercase + << std::hex + << std::setw(2) + << std::setfill('0') + // VWR-4010 Cannot cast to U32 because sign-extension on // chars > 128 will result in FFFFFFC3 instead of F3. - << static_cast(static_cast(val)); + << static_cast(static_cast(val)) + + // reset stream state + << std::nouppercase + << std::dec + << std::setfill(' '); } // static -- cgit v1.2.3 From a7c3fde789b0f15f0ccf650e59dc352451fc4e4a Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 15:45:07 -0800 Subject: partial fix for CID-219 Checker: STREAM_FORMAT_STATE Function: LLDate::toStream(std::basic_ostream>&) const File: /indra/llcommon/lldate.cpp --- indra/llcommon/lldate.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/lldate.cpp b/indra/llcommon/lldate.cpp index ca7e471bf2..e3323fcfbf 100644 --- a/indra/llcommon/lldate.cpp +++ b/indra/llcommon/lldate.cpp @@ -152,7 +152,8 @@ void LLDate::toStream(std::ostream& s) const s << '.' << std::setw(2) << (int)(exp_time.tm_usec / (LL_APR_USEC_PER_SEC / 100)); } - s << 'Z'; + s << 'Z' + << setfill(' '); } bool LLDate::split(S32 *year, S32 *month, S32 *day, S32 *hour, S32 *min, S32 *sec) const -- cgit v1.2.3 From 9e2ba40d13cd03525ce137435fd817a55758bc8c Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 15:45:41 -0800 Subject: less dumb partial fix for CID-219 --- indra/llcommon/lldate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/lldate.cpp b/indra/llcommon/lldate.cpp index e3323fcfbf..de7f2ead74 100644 --- a/indra/llcommon/lldate.cpp +++ b/indra/llcommon/lldate.cpp @@ -153,7 +153,7 @@ void LLDate::toStream(std::ostream& s) const << (int)(exp_time.tm_usec / (LL_APR_USEC_PER_SEC / 100)); } s << 'Z' - << setfill(' '); + << std::setfill(' '); } bool LLDate::split(S32 *year, S32 *month, S32 *day, S32 *hour, S32 *min, S32 *sec) const -- cgit v1.2.3 From e133a9824695d0286ca7717b1eb6a1c57748b898 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 15:49:22 -0800 Subject: CID-227 Checker: STRING_OVERFLOW Function: CProcessor::AnalyzeIntelProcessor() File: /indra/llcommon/llprocessor.cpp --- indra/llcommon/llprocessor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp index 469e544b16..8a4a4a8f9a 100644 --- a/indra/llcommon/llprocessor.cpp +++ b/indra/llcommon/llprocessor.cpp @@ -281,7 +281,8 @@ bool CProcessor::AnalyzeIntelProcessor() // already have a string here from GetCPUInfo(). JC if ( CPUInfo.uiBrandID < LL_ARRAY_SIZE(INTEL_BRAND) ) { - strcpy(CPUInfo.strBrandID, INTEL_BRAND[CPUInfo.uiBrandID]); + strncpy(CPUInfo.strBrandID, INTEL_BRAND[CPUInfo.uiBrandID], sizeof(CPUInfo.strBrandID)-1); + CPUInfo.strBrandID[sizeof(CPUInfo.strBrandID)-1]='\0'; if (CPUInfo.uiBrandID == 3 && CPUInfo.uiModel == 6) { -- cgit v1.2.3 From f6fceac081a1f2d165679ce3eb233e97806cebe7 Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Thu, 28 Jan 2010 15:51:49 +0200 Subject: fixed EXT-3841 [BSI] "Send IM..." choosable in IM floater context menu --HG-- branch : product-engine --- indra/llcommon/llchat.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llchat.h b/indra/llcommon/llchat.h index 5af7991006..46456882ba 100644 --- a/indra/llcommon/llchat.h +++ b/indra/llcommon/llchat.h @@ -87,7 +87,8 @@ public: mTimeStr(), mPosAgent(), mURL(), - mChatStyle(CHAT_STYLE_NORMAL) + mChatStyle(CHAT_STYLE_NORMAL), + mSessionID() { } std::string mText; // UTF-8 line of text @@ -102,6 +103,7 @@ public: LLVector3 mPosAgent; std::string mURL; EChatStyle mChatStyle; + LLUUID mSessionID; }; #endif -- cgit v1.2.3 From 86609394caf1ebb20dd90de37b9af1471ae8aa20 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Fri, 29 Jan 2010 17:48:10 +0200 Subject: =?UTF-8?q?fixed=20major=20EXT-3643=20=E2=80=9CEmbed=20friendship?= =?UTF-8?q?=20offer=20into=20IM=20window=E2=80=9D;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/llcommon/llchat.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llchat.h b/indra/llcommon/llchat.h index 46456882ba..a77bd211f3 100644 --- a/indra/llcommon/llchat.h +++ b/indra/llcommon/llchat.h @@ -79,6 +79,7 @@ public: : mText(text), mFromName(), mFromID(), + mNotifId(), mSourceType(CHAT_SOURCE_AGENT), mChatType(CHAT_TYPE_NORMAL), mAudible(CHAT_AUDIBLE_FULLY), @@ -94,6 +95,7 @@ public: std::string mText; // UTF-8 line of text std::string mFromName; // agent or object name LLUUID mFromID; // agent id or object id + LLUUID mNotifId; EChatSourceType mSourceType; EChatType mChatType; EChatAudible mAudible; -- cgit v1.2.3