summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-02-22 21:48:46 +0200
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-02-23 19:18:23 +0200
commitae7b318e7f21d0d372d48a635ff1e2ea59c4acf6 (patch)
treeafa967ba22f54cd2dee34cd73d790f0cfd9688e6 /indra/llui
parentae6aa3fc411baad073d24f10b4534e86fe77564c (diff)
viewer#875 Crash at uri normalization
Note that crash happened when setting LLProgressView::setMessage
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llurlentry.cpp18
-rw-r--r--indra/llui/llurlregistry.cpp6
2 files changed, 16 insertions, 8 deletions
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp
index 77e9edf5e5..05d821f5d8 100644
--- a/indra/llui/llurlentry.cpp
+++ b/indra/llui/llurlentry.cpp
@@ -234,14 +234,20 @@ bool LLUrlEntryBase::isWikiLinkCorrect(const std::string &labeled_url) const
std::string LLUrlEntryBase::urlToLabelWithGreyQuery(const std::string &url) const
{
+ if (url.empty())
+ {
+ return url;
+ }
LLUriParser up(escapeUrl(url));
- up.normalize();
-
- std::string label;
- up.extractParts();
- up.glueFirst(label);
+ if (up.normalize() == 0)
+ {
+ std::string label;
+ up.extractParts();
+ up.glueFirst(label);
- return unescapeUrl(label);
+ return unescapeUrl(label);
+ }
+ return std::string();
}
std::string LLUrlEntryBase::urlToGreyQuery(const std::string &url) const
diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp
index 3bd7321777..f1df7699e2 100644
--- a/indra/llui/llurlregistry.cpp
+++ b/indra/llui/llurlregistry.cpp
@@ -221,8 +221,10 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL
if (match_entry == mUrlEntryTrusted)
{
LLUriParser up(url);
- up.normalize();
- url = up.normalizedUri();
+ if (up.normalize() == 0)
+ {
+ url = up.normalizedUri();
+ }
}
match.setValues(match_start, match_end,