From e0974593d3635b5e0cb45bb7443fe329fa0e8dc7 Mon Sep 17 00:00:00 2001 From: Nicky Date: Tue, 10 Jun 2014 22:42:21 +0200 Subject: [PATCH] Fix some 0-pointer crashes we got with last merge. --- indra/llcommon/llerror.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 24cd9a8974..8c379c18f2 100755 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -566,7 +566,17 @@ namespace LLError mFunctionString += std::string(mFunction) + ":"; for (size_t i = 0; i < mTagCount; i++) { - mTagString += std::string("#") + mTags[i] + ((i == mTagCount - 1) ? "" : " "); + // Tags can be 0, so work around that. + + // mTagString += std::string("#") + mTags[i] + ((i == mTagCount - 1) ? "" : " "); + + char const *pTag = mTags[i]; + if( !pTag ) + pTag = ""; + + mTagString += std::string("#") + pTag + ((i == mTagCount - 1) ? "" : " "); + + // } } @@ -991,6 +1001,11 @@ namespace { for (size_t i = 0; i < count; i++) { + // Can be 0 + if( !keys[i] ) + continue; + // + LevelMap::const_iterator it = map.find(keys[i]); if (it != map.end()) {