summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2018-09-11 19:18:35 +0200
committerAndy Shaw <andy.shaw@qt.io>2018-09-13 17:07:57 +0000
commitc9f316c8b90ce8bb11b6e9e0bf898c269cd35bfb (patch)
treea04cfd3a97e45e085363d84e240eb5df51c7a6a8 /src/plugins
parent14bae62bd2e965a25e61564eb2f7e61ad7b1e9c2 (diff)
ODBC: Correctly check if the field is within the fieldCache range
This was found while running the ODBC tests. tst_QSqlQuery::isNull() accounts for this already. Change-Id: Idf99a85396d7aa4e69b89467f873b105ef946f7f Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/sqldrivers/odbc/qsql_odbc.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/sqldrivers/odbc/qsql_odbc.cpp b/src/plugins/sqldrivers/odbc/qsql_odbc.cpp
index daf9686b5e..1fbbcd0ef1 100644
--- a/src/plugins/sqldrivers/odbc/qsql_odbc.cpp
+++ b/src/plugins/sqldrivers/odbc/qsql_odbc.cpp
@@ -1307,7 +1307,7 @@ QVariant QODBCResult::data(int field)
bool QODBCResult::isNull(int field)
{
Q_D(const QODBCResult);
- if (field < 0 || field > d->fieldCache.size())
+ if (field < 0 || field >= d->fieldCache.size())
return true;
if (field <= d->fieldCacheIdx) {
// since there is no good way to find out whether the value is NULL