xmlsecurity/source/helper/xmlsignaturehelper.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit beb7dc01ebf8558232ae41976e88b1ee7ed7be0f
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sat Aug 31 16:24:57 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sat Aug 31 22:55:04 2024 +0200

    cid#1607713 silence Overflowed constant
    
    Change-Id: I0b3b924689685cfb7ae5cd64db5e3ef371541769
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172700
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/xmlsecurity/source/helper/xmlsignaturehelper.cxx 
b/xmlsecurity/source/helper/xmlsignaturehelper.cxx
index 731405e8ad0b..71c6ebdbce56 100644
--- a/xmlsecurity/source/helper/xmlsignaturehelper.cxx
+++ b/xmlsecurity/source/helper/xmlsignaturehelper.cxx
@@ -632,10 +632,10 @@ static auto CheckX509Data(
     chain.emplace_back(*start);
 
     // second, check that there is a chain, no tree or cycle...
-    for (size_t i = 0; i < certs.size(); ++i)
+    for (size_t i = 0, certs_size = certs.size(); i < certs_size; ++i)
     {
         assert(chain.size() == i + 1);
-        for (size_t j = 0; j < certs.size(); ++j)
+        for (size_t j = 0; j < certs_size; ++j)
         {
             if (chain[i] != j)
             {
@@ -651,7 +651,7 @@ static auto CheckX509Data(
                 }
             }
         }
-        if (i == certs.size() - 1)
+        if (i == certs_size - 1)
         {   // last one: must be a leaf
             if (chain.size() != i + 1)
             {

Reply via email to