diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-09-22 09:03:22 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-09-22 14:22:18 +0200 |
commit | 022289b2f028efba55f679cb2664092f0ffbc20a (patch) | |
tree | f1234f5c396b6e1992161f52a5d6a2eacc2db6a6 /unotools | |
parent | ddf695db44bcb23dc2f1459fd439f93c0b6d5f2a (diff) |
this originally checked for > 0
Change-Id: I3babab9dc6257ed9e07911e346fd1e56e26dc7c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140400
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/config/configpaths.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/unotools/source/config/configpaths.cxx b/unotools/source/config/configpaths.cxx index d3813f31fcf5..70043a60fbd9 100644 --- a/unotools/source/config/configpaths.cxx +++ b/unotools/source/config/configpaths.cxx @@ -81,14 +81,14 @@ bool splitLastFromConfigurationPath(std::u16string_view _sInPath, size_t nPos = _sInPath.size()-1; // strip trailing slash - if (nPos != std::u16string_view::npos && _sInPath[ nPos ] == '/') + if (nPos != std::u16string_view::npos && nPos > 0 && _sInPath[ nPos ] == '/') { OSL_FAIL("Invalid config path: trailing '/' is not allowed"); --nPos; } // check for predicate ['xxx'] or ["yyy"] - if (nPos != std::u16string_view::npos && _sInPath[ nPos ] == ']') + if (nPos != std::u16string_view::npos && nPos > 0 && _sInPath[ nPos ] == ']') { sal_Unicode chQuote = _sInPath[--nPos]; |