summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-09-12 11:25:46 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-09-12 22:06:40 +0200
commit6f7d8e1b239438ac0f6d8e17b7441b7c65ab4fde (patch)
tree30d67387a1a45e8e22c60d1febe9147c265cf7a6 /dbaccess
parentb9c37f62bf4e60ddde3925137727e4394be85cbb (diff)
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 <caolanm@redhat.com>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/filter/hsqldb/utils.cxx6
1 files changed, 6 insertions, 0 deletions
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;
}