summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-05-06 15:01:59 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2022-05-06 15:52:39 +0200
commit3a45029a6bd049006a896a789c7ad45eedfdb924 (patch)
tree1d37b9f8c39af25d8a44ee802027daddd889a7b8
parentbbb8617ece6d946957c2eb96287081029bce530f (diff)
Only dereference iterators after checking them
Was this way since commit edf11d28fafac50b6380c9372d0e6cf07a355616 Author Vladimir Glazounov <vg@openoffice.org> Date Thu Apr 24 16:27:52 2003 +0000 INTEGRATION: CWS uaa02 (1.3.44); FILE MERGED Surfaced after commit b1148c31ed2786396f0b018a988fce8288f1797d Author Noel Grandin <noel.grandin@collabora.co.uk> Date Wed Apr 27 16:47:53 2022 +0200 use more string_view in comphelper where the pointers were changed to iterators, which are checked in debug builds, failing an assertion. Change-Id: I87fce562aef8f50b94fb52ad6c2a79d2e84d6424 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133934 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--comphelper/source/misc/accessibletexthelper.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/comphelper/source/misc/accessibletexthelper.cxx b/comphelper/source/misc/accessibletexthelper.cxx
index bd2253ace23e..27747b3bca12 100644
--- a/comphelper/source/misc/accessibletexthelper.cxx
+++ b/comphelper/source/misc/accessibletexthelper.cxx
@@ -682,9 +682,8 @@ namespace comphelper
auto pLastDiffNew = rNewString.end();
// find first difference
- while ((*pFirstDiffOld == *pFirstDiffNew) &&
- (pFirstDiffOld < pLastDiffOld) &&
- (pFirstDiffNew < pLastDiffNew))
+ while ((pFirstDiffOld < pLastDiffOld) && (pFirstDiffNew < pLastDiffNew)
+ && (*pFirstDiffOld == *pFirstDiffNew))
{
pFirstDiffOld++;
pFirstDiffNew++;