Check arguments to prefs_find_preference().
authorStig Bjørlykke <stig@bjorlykke.org>
Sun, 14 Aug 2011 20:31:16 +0000 (20:31 -0000)
committerStig Bjørlykke <stig@bjorlykke.org>
Sun, 14 Aug 2011 20:31:16 +0000 (20:31 -0000)
Fix CID 1259.

svn path=/trunk/; revision=38540

epan/prefs.c

index 9ccf49c7c23ec1089c91db9baf5d48a31d34870c..c29082c2b5868152db17f15bbf4ae5503ce05898 100644 (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;
 }