aboutsummaryrefslogtreecommitdiff
path: root/ext/misc/memstat.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2018-10-08 20:04:16 +0000
committerdrh <drh@noemail.net>2018-10-08 20:04:16 +0000
commit7dd630a893454538092cce2ac811e85e6fb95190 (patch)
tree7b438f4685ed5be9fabf30c827921a0c41b08421 /ext/misc/memstat.c
parent5f8cb730afa1017e1ac1af53886027a6a3d98e4e (diff)
downloadsqlite-7dd630a893454538092cce2ac811e85e6fb95190.tar.gz
sqlite-7dd630a893454538092cce2ac811e85e6fb95190.zip
Fix an issue with the new memstat.c extension.
FossilOrigin-Name: ce6e80b1303ed161bec2c63735cd2e2bea7b4e9b4ff780d214d408b1a30d50da
Diffstat (limited to 'ext/misc/memstat.c')
-rw-r--r--ext/misc/memstat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/misc/memstat.c b/ext/misc/memstat.c
index 27cb404df..3194e752c 100644
--- a/ext/misc/memstat.c
+++ b/ext/misc/memstat.c
@@ -235,7 +235,7 @@ static int memstatNext(sqlite3_vtab_cursor *cur){
assert( pCur->iRowid<=MSV_NROW );
while(1){
i = (int)pCur->iRowid - 1;
- if( (aMemstatColumn[i].mNull & 2)!=0 || (++pCur->iDb)>=pCur->nDb ){
+ if( i<0 || (aMemstatColumn[i].mNull & 2)!=0 || (++pCur->iDb)>=pCur->nDb ){
pCur->iRowid++;
if( pCur->iRowid>MSV_NROW ) return SQLITE_OK; /* End of the table */
pCur->iDb = 0;