connectivity/source/drivers/dbase/dindexnode.cxx |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit dba433c1ee35969d9adfef7462c97f07fe206c68
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Mon Sep 30 20:40:06 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Wed Oct 2 12:25:31 2024 +0200

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

diff --git a/connectivity/source/drivers/dbase/dindexnode.cxx 
b/connectivity/source/drivers/dbase/dindexnode.cxx
index ba439d77bef4..0e4746a0b9a6 100644
--- a/connectivity/source/drivers/dbase/dindexnode.cxx
+++ b/connectivity/source/drivers/dbase/dindexnode.cxx
@@ -207,8 +207,13 @@ bool ONDXPage::Insert(ONDXNode& rNode, sal_uInt32 
nRowsLeft)
                 }
                 else  // position unknown
                 {
-                    sal_uInt16 nPos = NODE_NOTFOUND;
-                    while (++nPos < nCount && rNode.GetKey() > 
((*this)[nPos]).GetKey()) ;
+                    sal_uInt16 nPos = 0;
+                    while (nPos < nCount)
+                    {
+                        if (rNode.GetKey() <= ((*this)[nPos]).GetKey())
+                            break;
+                        ++nPos;
+                    }
 
                     --nCount;   // (otherwise we might get Assertions and GPFs 
- 60593)
                     bResult = Insert(nPos, rNode);

Reply via email to