ucb/source/ucp/file/filglob.cxx                    |    2 +-
 unodevtools/source/skeletonmaker/javatypemaker.cxx |    3 ++-
 unoidl/source/sourceprovider-parser.y              |    3 ++-
 3 files changed, 5 insertions(+), 3 deletions(-)

New commits:
commit b35a1ee2aa85d42a749c4380feb252dc4c1e143c
Author:     Caolán McNamara <[email protected]>
AuthorDate: Tue Sep 17 17:00:13 2024 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Wed Sep 18 18:03:24 2024 +0200

    cid#1607362 Overflowed constant
    
    and
    
    cid#1607419 Overflowed constant
    cid#1608605 Overflowed constant
    
    Change-Id: Ia63cc771021d8a8031c62582a2fa6a68dc214f08
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173614
    Reviewed-by: Caolán McNamara <[email protected]>
    Tested-by: Jenkins

diff --git a/ucb/source/ucp/file/filglob.cxx b/ucb/source/ucp/file/filglob.cxx
index ce719986961f..93fb4ad81a4d 100644
--- a/ucb/source/ucp/file/filglob.cxx
+++ b/ucb/source/ucp/file/filglob.cxx
@@ -187,7 +187,7 @@ namespace fileaccess {
     std::u16string_view getTitle( std::u16string_view aPath )
     {
         size_t lastIndex = aPath.rfind( '/' );
-        return aPath.substr( lastIndex + 1 );
+        return aPath.substr((lastIndex != std::u16string_view::npos) ? 
lastIndex + 1 : 0);
     }
 
 
diff --git a/unodevtools/source/skeletonmaker/javatypemaker.cxx 
b/unodevtools/source/skeletonmaker/javatypemaker.cxx
index 639438799d48..49a86e87d866 100644
--- a/unodevtools/source/skeletonmaker/javatypemaker.cxx
+++ b/unodevtools/source/skeletonmaker/javatypemaker.cxx
@@ -252,7 +252,8 @@ static void printConstructor(
     rtl::Reference< unoidl::Entity > const & entity, std::u16string_view name,
     std::vector< OUString > const & arguments)
 {
-    o << "public " << OUString(name.substr(name.rfind('.') + 1)) << '(';
+    std::u16string_view::size_type pos = name.rfind('.');
+    o << "public " << OUString(name.substr((pos != std::u16string_view::npos) 
? pos + 1 : 0)) << '(';
     printConstructorParameters(
         o, options, manager, sort, entity, name, arguments);
     o << ");
";
diff --git a/unoidl/source/sourceprovider-parser.y 
b/unoidl/source/sourceprovider-parser.y
index 0ce80ac5d9ac..2b126d4811bb 100644
--- a/unoidl/source/sourceprovider-parser.y
+++ b/unoidl/source/sourceprovider-parser.y
@@ -168,7 +168,8 @@ template<typename T> rtl::Reference<T> getCurrentPad(
 
 bool nameHasSameIdentifierAs(std::u16string_view name, std::u16string_view 
identifier)
 {
-    size_t i = name.rfind('.') + 1;
+    std::u16string_view::size_type pos = name.rfind('.');
+    size_t i = (pos != std::u16string_view::npos) ? pos + 1 : 0;
     return identifier.size() == name.size() - i
         && o3tl::starts_with(name.substr(i), identifier);
 }

Reply via email to