summaryrefslogtreecommitdiff
path: root/plugins/Dbx_sqlite/src/dbevents.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss@sss.chaoslab.ru>2020-05-10 13:08:18 +0300
committerGluzskiy Alexandr <sss@sss.chaoslab.ru>2020-05-10 13:09:25 +0300
commitd567fef38c438ec8854558ed0ff82e25fcde3a37 (patch)
treef2c56b7d6cc02e9920f1f0a68ea19020042bf716 /plugins/Dbx_sqlite/src/dbevents.cpp
parent5e132354765fc28b5fe6ca3121be30fc4b5aed04 (diff)
dbx_sqlite: fixed crash possibility if cursor with destroyed statement used
Diffstat (limited to 'plugins/Dbx_sqlite/src/dbevents.cpp')
-rwxr-xr-xplugins/Dbx_sqlite/src/dbevents.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/Dbx_sqlite/src/dbevents.cpp b/plugins/Dbx_sqlite/src/dbevents.cpp
index 42574318bd..bef40881e8 100755
--- a/plugins/Dbx_sqlite/src/dbevents.cpp
+++ b/plugins/Dbx_sqlite/src/dbevents.cpp
@@ -745,13 +745,15 @@ CDbxSQLiteEventCursor::~CDbxSQLiteEventCursor()
}
MEVENT CDbxSQLiteEventCursor::FetchNext()
{
+ if (!cursor)
+ return 0;
int rc = sqlite3_step(cursor);
assert(rc == SQLITE_ROW || rc == SQLITE_DONE);
if (rc != SQLITE_ROW) {
//empty response
//reset sql cursor
sqlite3_reset(cursor);
- cursor = 0;
+ cursor = nullptr;
return 0;
}
return sqlite3_column_int64(cursor, 0);