From d567fef38c438ec8854558ed0ff82e25fcde3a37 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Sun, 10 May 2020 13:08:18 +0300 Subject: dbx_sqlite: fixed crash possibility if cursor with destroyed statement used --- plugins/Dbx_sqlite/src/dbevents.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'plugins/Dbx_sqlite/src/dbevents.cpp') 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); -- cgit v1.2.3