sqlite addressbook: fix memory corruption in get_revision
authorPatrick Ohly <patrick.ohly@intel.com>
Wed, 3 Apr 2013 14:45:28 +0000 (07:45 -0700)
committerTristan Van Berkom <tristanvb@openismus.com>
Thu, 4 Apr 2013 08:50:50 +0000 (17:50 +0900)
commitf30f93eb173dd791b56488c82507320663bfd118
treea105ab269188f35182687db0cf13b306208df479
parent1b3050b60414231b26390bdf31a55510b085492c
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.
addressbook/libedata-book/e-book-backend-sqlitedb.c