summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-10-21 09:53:57 +0200
committerNoel Grandin <noel@peralex.com>2013-10-23 13:12:55 +0200
commit8396cce9b5d9a4e3cdccc558eb1b818460f0987a (patch)
treec573d21f50405516245cbfc11630c589a098a855 /svl
parent763114f8b7a7705e1b28226da33bf00016ad7982 (diff)
clean up places accessing the NULL at the of an OUString
There were only a couple of real bugs fixed, but we're a little bit safer now. This also fixes the assert and the comment in OUString::operator[] about this. Change-Id: Ibe16b5794e0ba7ecd345fa0801586d25b015974c
Diffstat (limited to 'svl')
-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