From e03f1521c82545a49b289d624c8b26be3d1fb3d6 Mon Sep 17 00:00:00 2001
From: Mnikolenko ProductEngine <mnikolenko@productengine.com>
Date: Thu, 2 Apr 2015 11:50:17 +0300
Subject: [PATCH] MAINT-5023 URIparser crash in
 LLUrlEntryBase::urlToLabelWithGreyQuery

---
 indra/llcommon/lluriparser.cpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/indra/llcommon/lluriparser.cpp b/indra/llcommon/lluriparser.cpp
index e24e53426ed..8c456ee8798 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)
 	{
-- 
GitLab