fix off-by-one index check
Change-Id: I6d6461eec24895e9aa0e77deccd39210958b7e2c Reviewed-by: Andy Shaw <andy.shaw@digia.com>
This commit is contained in:
parent
971bdc90e9
commit
96a22ed926
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user