If a config file does not even contain a single session,
g_key_file_get_start_group() will return NULL, resulting in a segfault
if we feed that to strcmp. Check for that possibility.
This closes Fedora bug #454099, BTW. Merry christmas ;-)
GArray *retval=NULL;
gchar **groups;
gboolean value;
+ gchar* startgroup;
gint i;
gint j;
g_key_file_free(cfile);
return retval;
}
- if(strcmp(g_key_file_get_start_group(cfile), "generic")) {
+ startgroup = g_key_file_get_start_group(cfile);
+ if(!startgroup || strcmp(startgroup, "generic")) {
g_set_error(e, errdomain, CFILE_MISSING_GENERIC, "Config file does not contain the [generic] group!");
g_key_file_free(cfile);
return NULL;