summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMark Brand <mabrand@mabrand.nl>2013-07-01 12:45:37 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-02 08:51:05 (GMT)
commit6d4093df094d64d5ffd98e0e536d9f6680e6ece1 (patch)
tree6c284b4506655c54e7cd8c1fe1da611072924d61 /src
parentc7ce63313d06454966a777bf84bf3f4b4a48ab61 (diff)
downloadQt-6d4093df094d64d5ffd98e0e536d9f6680e6ece1.zip
Qt-6d4093df094d64d5ffd98e0e536d9f6680e6ece1.tar.gz
Qt-6d4093df094d64d5ffd98e0e536d9f6680e6ece1.tar.bz2
fix off-by-one index check
Change-Id: I6d6461eec24895e9aa0e77deccd39210958b7e2c Reviewed-by: Andy Shaw <andy.shaw@digia.com> (cherry picked from qtbase/96a22ed926cfd706c1b5aca1881f124bc9624f2f)
Diffstat (limited to 'src')
-rw-r--r--src/sql/kernel/qsqlcachedresult.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sql/kernel/qsqlcachedresult.cpp b/src/sql/kernel/qsqlcachedresult.cpp
index 69feabc..e8e198f 100644
--- a/src/sql/kernel/qsqlcachedresult.cpp
+++ b/src/sql/kernel/qsqlcachedresult.cpp
@@ -253,7 +253,7 @@ QVariant QSqlCachedResult::data(int i)
bool QSqlCachedResult::isNull(int i)
{
int idx = d->forwardOnly ? i : at() * d->colCount + i;
- if (i > d->colCount || i < 0 || at() < 0 || idx >= d->rowCacheEnd)
+ if (i >= d->colCount || i < 0 || at() < 0 || idx >= d->rowCacheEnd)
return true;
return d->cache.at(idx).isNull();