Skip to content
Snippets Groups Projects
Commit dbb304ab authored by MNikolenko ProductEngine's avatar MNikolenko ProductEngine
Browse files

MAINT-5023 FIXED URIparser crash in LLUrlEntryBase::urlToLabelWithGreyQuery

parent e03f1521
No related branches found
No related tags found
No related merge requests found
...@@ -118,29 +118,27 @@ void LLUriParser::fragment(const std::string& s) ...@@ -118,29 +118,27 @@ void LLUriParser::fragment(const std::string& s)
void LLUriParser::textRangeToString(UriTextRangeA& textRange, std::string& str) void LLUriParser::textRangeToString(UriTextRangeA& textRange, std::string& str)
{ {
str = "";
if(&textRange == NULL) if(&textRange == NULL)
{ {
LL_WARNS() << "textRange is NULL for uri: " << mNormalizedUri << LL_ENDL;
return; return;
} }
if(textRange.first == NULL) if(textRange.first == NULL)
{ {
LL_WARNS() << "textRange.first is NULL for uri: " << mNormalizedUri << LL_ENDL;
return; return;
} }
if(textRange.afterLast == NULL) if(textRange.afterLast == NULL)
{ {
LL_WARNS() << "textRange.afterLast is NULL for uri: " << mNormalizedUri << LL_ENDL;
return; return;
} }
S32 len = textRange.afterLast - textRange.first; S32 len = textRange.afterLast - textRange.first;
if (len) if (len)
{ {
str = textRange.first; str.assign(textRange.first, len);
str = str.substr(0, len);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment