summaryrefslogtreecommitdiff
path: root/svl/source/misc/urihelper.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svl/source/misc/urihelper.cxx')
-rw-r--r--svl/source/misc/urihelper.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx
index 32df0b69748a..f147f1a810a3 100644
--- a/svl/source/misc/urihelper.cxx
+++ b/svl/source/misc/urihelper.cxx
@@ -527,7 +527,7 @@ OUString URIHelper::FindFirstURLInText(OUString const & rText,
while (i != rEnd
&& checkWChar(rCharClass, rText, &i, &nUriEnd, true,
true)) ;
- if (i != nPrefixEnd && rText[i] == (sal_Unicode)'#')
+ if (i != nPrefixEnd && i != rEnd && rText[i] == '#')
{
++i;
while (i != rEnd
@@ -555,7 +555,7 @@ OUString URIHelper::FindFirstURLInText(OUString const & rText,
sal_Int32 nUriEnd = i;
while (i != rEnd
&& checkWChar(rCharClass, rText, &i, &nUriEnd)) ;
- if (i != nPrefixEnd && rText[i] == '#')
+ if (i != nPrefixEnd && i != rEnd && rText[i] == '#')
{
++i;
while (i != rEnd