diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-09-22 09:10:26 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-09-22 14:22:31 +0200 |
commit | a64204cc26745e7652cb71ee2ed39a9ae00b09cd (patch) | |
tree | 61376d5bb53a013193b3494f8ffa9499290e5963 /unotools | |
parent | 022289b2f028efba55f679cb2664092f0ffbc20a (diff) |
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 <caolanm@redhat.com>
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/config/configpaths.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
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] { |