diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2024-10-26 11:38:51 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2024-10-26 11:48:20 +0200 |
commit | 6130b0f8cdc5bddbf96ea27a77882835b233c099 (patch) | |
tree | 0c6619138e360ab70c5ae748d494c5b0c9e7ac0e /accessibility | |
parent | 433eb742c0ff81ff568e4a5f469a6ad4c827b8f5 (diff) |
Revert "tdf#163486: PVS: Array overrun is possible"
This reverts commit 433eb742c0ff81ff568e4a5f469a6ad4c827b8f5.
Reason for revert: see Mike's comment
Change-Id: I72832edf3d94e015a44e9764d9139fb41c521097
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175613
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'accessibility')
-rw-r--r-- | accessibility/source/extended/textwindowaccessibility.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx index 6f80a7a8f86f..9021f85af610 100644 --- a/accessibility/source/extended/textwindowaccessibility.cxx +++ b/accessibility/source/extended/textwindowaccessibility.cxx @@ -1005,14 +1005,14 @@ Document::retrieveCharacterAttributes( // sort the attributes auto nLength = static_cast<size_t>(aRes.getLength()); std::unique_ptr<sal_Int32[]> pIndices( new sal_Int32[nLength] ); - std::iota(&pIndices[0], &pIndices[nLength-1], 0); - std::sort(&pIndices[0], &pIndices[nLength-1], + std::iota(&pIndices[0], &pIndices[nLength], 0); + std::sort(&pIndices[0], &pIndices[nLength], [&aRes](sal_Int32 a, sal_Int32 b) { return aRes[a].Name < aRes[b].Name; }); // create sorted sequences according to index array std::vector<css::beans::PropertyValue> aNewValues; aNewValues.reserve(nLength); - std::transform(&pIndices[0], &pIndices[nLength-1], std::back_inserter(aNewValues), + std::transform(&pIndices[0], &pIndices[nLength], std::back_inserter(aNewValues), [&aRes](const sal_Int32 nIdx) -> const css::beans::PropertyValue& { return aRes[nIdx]; }); return comphelper::containerToSequence(aNewValues); |