Check arguments to prefs_find_preference().
authorstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 14 Aug 2011 20:31:16 +0000 (20:31 +0000)
committerstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 14 Aug 2011 20:31:16 +0000 (20:31 +0000)
Fix CID 1259.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@38540 f5534014-38df-0310-8fa8-9805f1628bb7

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;
 }