unotools/source/config/configpaths.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
New commits: commit a64204cc26745e7652cb71ee2ed39a9ae00b09cd Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Sep 22 09:10:26 2022 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Sep 22 14:22:31 2022 +0200 cid#1515531 Out-of-bounds access Change-Id: I543c9a14dcba3b448c2bd1197e46fae8e3b76ab8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140401 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/unotools/source/config/configpaths.cxx b/unotools/source/config/configpaths.cxx index 70043a60fbd9..4e5002238d93 100644 --- a/unotools/source/config/configpaths.cxx +++ b/unotools/source/config/configpaths.cxx @@ -97,7 +97,8 @@ bool splitLastFromConfigurationPath(std::u16string_view _sInPath, nEnd = nPos; nPos = _sInPath.find(chQuote,nEnd); nStart = nPos + 1; - --nPos; // nPos = rInPath.lastIndexOf('[',nPos); + if (nPos != std::u16string_view::npos) + --nPos; // nPos = rInPath.lastIndexOf('[',nPos); } else // allow [xxx] {