accessibility/source/extended/textwindowaccessibility.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
New commits: commit 6130b0f8cdc5bddbf96ea27a77882835b233c099 Author: Julien Nabet <serval2...@yahoo.fr> AuthorDate: Sat Oct 26 11:38:51 2024 +0200 Commit: Julien Nabet <serval2...@yahoo.fr> CommitDate: Sat Oct 26 11:48:20 2024 +0200 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 <serval2...@yahoo.fr> Tested-by: Julien Nabet <serval2...@yahoo.fr> 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);