From 18bacca5ca066c6fb1b38a82e322b624923b7340 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Tue, 24 Mar 2015 18:30:40 +0200 Subject: MAINT-5023 URIparser crash in LLUrlEntryBase::urlToLabelWithGreyQuery --- indra/llcommon/lluriparser.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/lluriparser.cpp b/indra/llcommon/lluriparser.cpp index d07288f123..08b19c56e0 100644 --- a/indra/llcommon/lluriparser.cpp +++ b/indra/llcommon/lluriparser.cpp @@ -118,6 +118,12 @@ void LLUriParser::fragment(const std::string& s) void LLUriParser::textRangeToString(UriTextRangeA& textRange, std::string& str) { + if(&textRange == NULL) + { + LL_WARNS() << "textRange is NULL for uri: " << mNormalizedUri << LL_ENDL; + return; + } + S32 len = textRange.afterLast - textRange.first; if (len) { @@ -128,6 +134,12 @@ void LLUriParser::textRangeToString(UriTextRangeA& textRange, std::string& str) void LLUriParser::extractParts() { + if(&mUri == NULL) + { + LL_WARNS() << "mUri is NULL for uri: " << mNormalizedUri << LL_ENDL; + return; + } + if (mTmpScheme) { mScheme.clear(); -- cgit v1.2.3 From b10940e8e38db7c7fc4adbd73ad8a56dec2b58f3 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Fri, 27 Mar 2015 11:23:58 +0200 Subject: MAINT-5019 FIXED Undesired http:// added to domains sent in chat --- indra/llcommon/lluriparser.cpp | 5 +++-- indra/llcommon/lluriparser.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/lluriparser.cpp b/indra/llcommon/lluriparser.cpp index 08b19c56e0..e24e53426e 100644 --- a/indra/llcommon/lluriparser.cpp +++ b/indra/llcommon/lluriparser.cpp @@ -29,7 +29,7 @@ #include "linden_common.h" #include "lluriparser.h" -LLUriParser::LLUriParser(const std::string& u) : mTmpScheme(false), mRes(0) +LLUriParser::LLUriParser(const std::string& u) : mTmpScheme(false), mNormalizedTmp(false), mRes(0) { mState.uri = &mUri; @@ -140,7 +140,7 @@ void LLUriParser::extractParts() return; } - if (mTmpScheme) + if (mTmpScheme || mNormalizedTmp) { mScheme.clear(); } @@ -169,6 +169,7 @@ void LLUriParser::extractParts() S32 LLUriParser::normalize() { + mNormalizedTmp = mTmpScheme; if (!mRes) { mRes = uriNormalizeSyntaxExA(&mUri, URI_NORMALIZE_SCHEME | URI_NORMALIZE_HOST); diff --git a/indra/llcommon/lluriparser.h b/indra/llcommon/lluriparser.h index e987bae924..561431e8f9 100644 --- a/indra/llcommon/lluriparser.h +++ b/indra/llcommon/lluriparser.h @@ -81,6 +81,7 @@ private: S32 mRes; bool mTmpScheme; + bool mNormalizedTmp; }; #endif // LL_LLURIPARSER_H -- cgit v1.2.3 From e03f1521c82545a49b289d624c8b26be3d1fb3d6 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Thu, 2 Apr 2015 11:50:17 +0300 Subject: MAINT-5023 URIparser crash in LLUrlEntryBase::urlToLabelWithGreyQuery --- indra/llcommon/lluriparser.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/lluriparser.cpp b/indra/llcommon/lluriparser.cpp index e24e53426e..8c456ee879 100644 --- a/indra/llcommon/lluriparser.cpp +++ b/indra/llcommon/lluriparser.cpp @@ -124,6 +124,18 @@ void LLUriParser::textRangeToString(UriTextRangeA& textRange, std::string& str) return; } + if(textRange.first == NULL) + { + LL_WARNS() << "textRange.first is NULL for uri: " << mNormalizedUri << LL_ENDL; + return; + } + + if(textRange.afterLast == NULL) + { + LL_WARNS() << "textRange.afterLast is NULL for uri: " << mNormalizedUri << LL_ENDL; + return; + } + S32 len = textRange.afterLast - textRange.first; if (len) { -- cgit v1.2.3 From dbb304ab2032153bbd2e5bdd589f6ed72d70a0a1 Mon Sep 17 00:00:00 2001 From: MNikolenko ProductEngine Date: Tue, 7 Apr 2015 20:58:48 +0300 Subject: MAINT-5023 FIXED URIparser crash in LLUrlEntryBase::urlToLabelWithGreyQuery --- indra/llcommon/lluriparser.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/lluriparser.cpp b/indra/llcommon/lluriparser.cpp index 8c456ee879..8270c630d8 100644 --- a/indra/llcommon/lluriparser.cpp +++ b/indra/llcommon/lluriparser.cpp @@ -118,29 +118,27 @@ void LLUriParser::fragment(const std::string& s) void LLUriParser::textRangeToString(UriTextRangeA& textRange, std::string& str) { + str = ""; + if(&textRange == NULL) { - LL_WARNS() << "textRange is NULL for uri: " << mNormalizedUri << LL_ENDL; return; } if(textRange.first == NULL) { - LL_WARNS() << "textRange.first is NULL for uri: " << mNormalizedUri << LL_ENDL; return; } if(textRange.afterLast == NULL) { - LL_WARNS() << "textRange.afterLast is NULL for uri: " << mNormalizedUri << LL_ENDL; return; } S32 len = textRange.afterLast - textRange.first; if (len) { - str = textRange.first; - str = str.substr(0, len); + str.assign(textRange.first, len); } } -- cgit v1.2.3