From 8396cce9b5d9a4e3cdccc558eb1b818460f0987a Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 21 Oct 2013 09:53:57 +0200 Subject: 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 --- svl/source/misc/urihelper.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'svl') 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 -- cgit