summaryrefslogtreecommitdiff
path: root/sal/rtl
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-03-09 11:25:54 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2022-03-09 14:04:03 +0100
commitdcd5fa0a7b896fd585ef964cf62ae70d247250f1 (patch)
treeef51bf00d1fe6b09dd21f701a3c423d7e4ec4560 /sal/rtl
parentdd4dbc70d413ada95632eb818b4d435a14e87303 (diff)
Drop misguided test added in 82a1d32d3d3ac1b4b0a6d4cfaca791c77d9b3c03
The documented precondition is that index must not be greater than the length of string. Just assert that, and fix the found misuse. The added test is for in-place replacement, just in case. Change-Id: I3c545a6f0bf913fe93e2bef83ce733359c193065 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131232 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sal/rtl')
-rw-r--r--sal/rtl/strtmpl.hxx1
1 files changed, 1 insertions, 0 deletions
diff --git a/sal/rtl/strtmpl.hxx b/sal/rtl/strtmpl.hxx
index 0f0cc6755eb3..07ea6d6cbba8 100644
--- a/sal/rtl/strtmpl.hxx
+++ b/sal/rtl/strtmpl.hxx
@@ -1256,6 +1256,7 @@ sal_Int32 getToken ( IMPL_RTL_STRINGDATA** ppThis
{
assert(ppThis);
assert(pStr);
+ assert(nIndex <= pStr->length);
// Set ppThis to an empty string and return -1 if either nToken or nIndex is
// negative: