From ae7b318e7f21d0d372d48a635ff1e2ea59c4acf6 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 22 Feb 2024 21:48:46 +0200 Subject: viewer#875 Crash at uri normalization Note that crash happened when setting LLProgressView::setMessage --- indra/llui/llurlentry.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'indra/llui/llurlentry.cpp') 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 -- cgit v1.2.3