libqt5-qtbase/0001-sqlite-Check-that-there-are-values-to-be-set-when-bi.patch
Dominique Leuenberger 24f02395f2 Accepting request 602103 from KDE:Qt5
- Add patches to fix crashes with certain sqlite queries:
  * 0001-sqlite-Check-that-there-are-values-to-be-set-when-bi.patch
  * 0002-sqlite-Bind-duplicated-named-placeholders-correctly.patch
  * 0003-sqlite-Prevent-a-crash-when-sqlite-does-not-detect-a.patch

OBS-URL: https://build.opensuse.org/request/show/602103
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libqt5-qtbase?expand=0&rev=80
2018-04-30 20:50:53 +00:00

34 lines
1.3 KiB
Diff

From cd12671fac459b71d2f5f65d3e221e4e8fca25f1 Mon Sep 17 00:00:00 2001
From: Andy Shaw <andy.shaw@qt.io>
Date: Thu, 7 Dec 2017 16:01:48 +0100
Subject: [PATCH 1/3] sqlite: Check that there are values to be set when
binding
If the values vector is empty then we know already that the paramCount
will still be invalid, so we should just accept that and not check the
reused named placeholders.
Task-number: QTBUG-64923
Change-Id: Ifaa755540c4574f1f76d3f9f129bf0f66b837b70
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
---
src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
index e9f5ee9508..67dd1a6ee5 100644
--- a/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
+++ b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
@@ -467,7 +467,7 @@ bool QSQLiteResult::exec()
#if (SQLITE_VERSION_NUMBER >= 3003011)
// In the case of the reuse of a named placeholder
- if (!paramCountIsValid) {
+ if (paramCount < values.count()) {
const auto countIndexes = [](int counter, const QList<int>& indexList) {
return counter + indexList.length();
};
--
2.16.2