[evolution-data-server/openismus-work] sqlite addressbook: fix memory corruption in get_revision



commit 00f5668244b134b92d6fa366248a6528db5aadb9
Author: Patrick Ohly <patrick ohly intel com>
Date:   Wed Apr 3 07:45:28 2013 -0700

    sqlite addressbook: fix memory corruption in get_revision
    
    Instead of setting a pointer, the pointer pointing to the pointer was
    overwritten. As a result, e_book_backend_file_load_revision() always saw a
    NULL pointer when opening the address book (regardless whether in
    evolution-addressbook-factory or a DRA client) and used
    e_book_backend_file_bump_revision() to write a new revision.
    
    It is not entirely clear whether overwriting the wrong pointer (which was on
    the stack and thus should not have been that important) or these concurrent
    writes were to blame, but testing shows that this fix solves a mysterious
    sqlite query failure ("corrupt database") in the DRA client when running
    SyncEvolution's testpim.py TestContacts.testFilterStartupRefineSmart.
    
    Fixes BGO #697173.

 .../libedata-book/e-book-backend-sqlitedb.c        |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/addressbook/libedata-book/e-book-backend-sqlitedb.c 
b/addressbook/libedata-book/e-book-backend-sqlitedb.c
index d8cf6d4..3625037 100644
--- a/addressbook/libedata-book/e-book-backend-sqlitedb.c
+++ b/addressbook/libedata-book/e-book-backend-sqlitedb.c
@@ -4135,7 +4135,7 @@ e_book_backend_sqlitedb_get_revision (EBookBackendSqliteDB *ebsdb,
        stmt = sqlite3_mprintf (
                "SELECT revision FROM folders WHERE folder_id = %Q", folderid);
        success = book_backend_sql_exec (
-               ebsdb->priv->db, stmt, get_string_cb, &revision_out, error);
+               ebsdb->priv->db, stmt, get_string_cb, revision_out, error);
        sqlite3_free (stmt);
 
        UNLOCK_MUTEX (&ebsdb->priv->lock);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]