[dconf] engine: fix dconf_engine_list() with empty db
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf] engine: fix dconf_engine_list() with empty db
- Date: Sun, 15 Jul 2012 23:56:20 +0000 (UTC)
commit 0c9bee1cc0963f6c57dc8f7ffe9e86f216f6ac13
Author: Ryan Lortie <desrt desrt ca>
Date: Sun Jul 15 19:53:32 2012 -0400
engine: fix dconf_engine_list() with empty db
If we opened an empty database file (like on first login) and did a
'dconf list' on it then we would crash (due to accessing the GVDB
without checking for NULL).
Add a check.
engine/dconf-engine.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/engine/dconf-engine.c b/engine/dconf-engine.c
index b1c0dd3..89a0c67 100644
--- a/engine/dconf-engine.c
+++ b/engine/dconf-engine.c
@@ -583,6 +583,9 @@ dconf_engine_list (DConfEngine *engine,
gchar **partial_list;
gint j;
+ if (engine->sources[i]->values == NULL)
+ continue;
+
partial_list = gvdb_table_list (engine->sources[i]->values, dir);
if (partial_list != NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]