Check arguments to prefs_find_preference().

Fix CID 1259.

svn path=/trunk/; revision=38540
This commit is contained in:
Stig Bjørlykke 2011-08-14 20:31:16 +00:00
parent 532247bc52
commit a17cde69ec
1 changed files with 4 additions and 0 deletions

View File

@ -640,11 +640,15 @@ prefs_find_preference(module_t *module, const char *name)
{
GList *list_entry;
if (module == NULL)
return NULL; /* invalid parameters */
list_entry = g_list_find_custom(module->prefs, name,
preference_match);
if (list_entry == NULL)
return NULL; /* no such preference */
return (struct preference *) list_entry->data;
}