[dconf] Fix crash when user database is not present
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf] Fix crash when user database is not present
- Date: Sun, 8 May 2011 12:10:53 +0000 (UTC)
commit c80896f5644ec0a07822047dd7e899da63b42e89
Author: Ryan Lortie <desrt desrt ca>
Date: Sun May 8 14:08:38 2011 +0200
Fix crash when user database is not present
If we fail to open the database in the user's home directory then the
variable will be NULL. The refactor of the read function for lockdown
support missed this check, resulting in a rather dramatic crash on fresh
accounts.
engine/dconf-engine.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/engine/dconf-engine.c b/engine/dconf-engine.c
index ec99116..087d780 100644
--- a/engine/dconf-engine.c
+++ b/engine/dconf-engine.c
@@ -452,7 +452,11 @@ dconf_engine_read_internal (DConfEngine *engine,
break;
while (i < limit && value == NULL)
- value = gvdb_table_get_value (engine->gvdbs[i++], key);
+ {
+ if (engine->gvdbs[i] != NULL)
+ value = gvdb_table_get_value (engine->gvdbs[i], key);
+ i++;
+ }
g_static_mutex_unlock (&engine->lock);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]