Skip to content
Snippets Groups Projects
Commit bbd071f3 authored by Andrey Kleshchev's avatar Andrey Kleshchev
Browse files

SL-14597 ensure that uris don't crash viewer

parent bee13995
Branches
Tags
No related merge requests found
...@@ -162,6 +162,11 @@ S32 LLUriParser::normalize() ...@@ -162,6 +162,11 @@ S32 LLUriParser::normalize()
{ {
mNormalizedTmp = mTmpScheme; mNormalizedTmp = mTmpScheme;
if (!mRes) if (!mRes)
{
// Uriparser is 3p software we can not directly fix.
// On winodws this probably requires SEH handling, but all
// crashes so far were on MAC in scope of uriNormalizeSyntaxExA.
try
{ {
mRes = uriNormalizeSyntaxExA(&mUri, URI_NORMALIZE_SCHEME | URI_NORMALIZE_HOST); mRes = uriNormalizeSyntaxExA(&mUri, URI_NORMALIZE_SCHEME | URI_NORMALIZE_HOST);
...@@ -184,6 +189,12 @@ S32 LLUriParser::normalize() ...@@ -184,6 +189,12 @@ S32 LLUriParser::normalize()
} }
} }
} }
catch (...)
{
// At this point mNormalizedUri should contain http+unmodified input string.
LL_WARNS() << "Uriparser crashed processing: " << mNormalizedUri << LL_ENDL;
}
}
if(mTmpScheme) if(mTmpScheme)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment