prefs: fix crash with -o column.foo:x

The gui.column module is somehow special, it has no name since it is
part of the gui module. This causes a crash when trying to invoke
`strcmp(module->name /* NULL */, "mgcp")`.

Always look up prefs inside gui_column_module when the given prefs
module is "column" instead of matching two specific names.

Change-Id: I47e354d11b6fd01818b0627a249b506a8f9510cc
Reviewed-on: https://code.wireshark.org/review/16937
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
This commit is contained in:
Peter Wu 2016-08-07 12:58:59 +02:00
parent 2a80b407ea
commit 1ea6b4fe2e
1 changed files with 3 additions and 3 deletions

View File

@ -4172,10 +4172,10 @@ set_pref(gchar *pref_name, const gchar *value, void *private_data _U_,
/* "gui" prefix was added to column preferences for better organization
* within the preferences file
*/
if ((strcmp(pref_name, PRS_COL_HIDDEN) == 0) ||
(strcmp(pref_name, PRS_COL_FMT) == 0)) {
if (module == gui_column_module) {
/* While this has a subtree, there is no apply callback, so no
* need to use prefs_find_preference_with_submodule. */
* need to use prefs_find_preference_with_submodule to update
* containing_module. It would not be useful. */
pref = prefs_find_preference(module, pref_name);
}
else if (strcmp(module->name, "mgcp") == 0) {