Comment 6 for bug 981053

Revision history for this message
Thomas Bushnell BSG (tb-becket) wrote : Re: Creating system dconf configuration crashes lightdm

I believe I see the bug. I'm not in a position to conveniently test it, and I'm terribly confident of the data model.

But in a struct _GvdbTable, there is a pointer "const gchar *data". In gvdb_table_new, this is initialized to the contents of the file passed in. Then gvdb_table_is_valid is checked, which does this:
  return !!*table->data;

Note carefully. What that does is check whether the first byte of the table's contents is zero or not. IOW, there's an extra dereference. The point is actually, presumably, to check whether the data pointer is NULL, not whether the first byte is zero. For an empty file, of course, the first byte dereference fails entirely.