unotools/source/config/configpaths.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 022289b2f028efba55f679cb2664092f0ffbc20a
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Sep 22 09:03:22 2022 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Sep 22 14:22:18 2022 +0200

    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 <caol...@redhat.com>

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];
 

Reply via email to