[tracker/wip/carlosg/wal-and-other-fixes: 3/8] libtracker-data: Fix possible invalid write
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/wal-and-other-fixes: 3/8] libtracker-data: Fix possible invalid write
- Date: Wed, 1 Jul 2020 17:39:55 +0000 (UTC)
commit bc877e56a7d7c4573ac997d64800702a0e26ab66
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Jun 28 11:14:10 2020 +0200
libtracker-data: Fix possible invalid write
If the last reference to the TrackerDBStatement is held by the "grab",
we would end up destroying it here in the stmt_is_used paths, we shouldn't
access its memory afterwards.
src/libtracker-data/tracker-db-interface-sqlite.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-data/tracker-db-interface-sqlite.c
b/src/libtracker-data/tracker-db-interface-sqlite.c
index 20ad51610..5b36084a9 100644
--- a/src/libtracker-data/tracker-db-interface-sqlite.c
+++ b/src/libtracker-data/tracker-db-interface-sqlite.c
@@ -3001,14 +3001,14 @@ tracker_db_statement_sqlite_release (TrackerDBStatement *stmt)
g_assert (stmt->stmt_is_owned);
+ stmt->stmt_is_owned = FALSE;
+
if (stmt->stmt_is_used) {
stmt->stmt_is_used = FALSE;
tracker_db_statement_sqlite_reset (stmt);
g_object_unref (stmt);
g_object_unref (iface);
}
-
- stmt->stmt_is_owned = FALSE;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]