dbaccess/source/filter/hsqldb/utils.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 6f7d8e1b239438ac0f6d8e17b7441b7c65ab4fde
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Sep 12 11:25:46 2022 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Sep 12 22:06:40 2022 +0200

    cid#1509268 Out-of-bounds access
    
    Change-Id: Ib649072ec0a28cd928d40e3fe2e0c6a50ba3e029
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139792
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/dbaccess/source/filter/hsqldb/utils.cxx 
b/dbaccess/source/filter/hsqldb/utils.cxx
index 724ffccfb37f..8387a34e0bf4 100644
--- a/dbaccess/source/filter/hsqldb/utils.cxx
+++ b/dbaccess/source/filter/hsqldb/utils.cxx
@@ -21,6 +21,7 @@
 #include <comphelper/string.hxx>
 #include <comphelper/processfactory.hxx>
 #include <connectivity/dbexception.hxx>
+#include <sal/log.hxx>
 
 #include "utils.hxx"
 
@@ -109,6 +110,11 @@ OUString utils::getTableNameFromStmt(std::u16string_view 
sSql)
         while (!bProperEndAposFound)
         {
             nAposEnd = sSql.find('"', nAposEnd + 1);
+            if (nAposEnd == std::u16string_view::npos)
+            {
+                SAL_WARN("dbaccess", "no matching \"");
+                return OUString();
+            }
             if (sSql[nAposEnd - 1] != u'\\')
                 bProperEndAposFound = true;
         }

Reply via email to