[Libreoffice-commits] core.git: xmloff/source

Jan-Marek Glogowski (via logerrit) logerrit at kemper.freedesktop.org
Wed Jun 30 12:37:38 UTC 2021


 xmloff/source/transform/TransformerBase.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit a876055b6f56e838114cce041d4c49aed43693f9
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Wed Jun 30 11:01:06 2021 +0000
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Wed Jun 30 14:37:02 2021 +0200

    Fix potential (but unlikely) overflow
    
    warning: assuming signed overflow does not occur when assuming
    that (X + c) >= X is always true [-Wstrict-overflow]
                     while( nPos < nLen )
                            ~~~~~^~~~~~
    
    Change-Id: I95e3bb4a131eaf4e82fbc74cc0bea92930b6afe9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118159
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>

diff --git a/xmloff/source/transform/TransformerBase.cxx b/xmloff/source/transform/TransformerBase.cxx
index c937e00ca2c4..8814d19f26af 100644
--- a/xmloff/source/transform/TransformerBase.cxx
+++ b/xmloff/source/transform/TransformerBase.cxx
@@ -1315,12 +1315,12 @@ bool XMLTransformerBase::ConvertURIToOOo( OUString& rURI,
                     {
                     case '/':
                         // a relative path segment within the package
-                        nPos = nLen;    // leave loop
+                        nPos = nLen - 1;    // leave loop
                         break;
                     case ':':
                         // a schema
                         bPackage = false;
-                        nPos = nLen;    // leave loop
+                        nPos = nLen - 1;    // leave loop
                         break;
                     default:
                         // we don't care about any other characters


More information about the Libreoffice-commits mailing list