summaryrefslogtreecommitdiffstats
path: root/epan/prefs.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-26 17:44:17 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-26 17:44:17 +0000
commit2d78050fd56b8188aa5a65ad2667e301b60eea45 (patch)
treeb54d4adac6de0a196b8bb8a67b34fe186c21378f /epan/prefs.c
parentAdding upstream version 4.2.2. (diff)
downloadwireshark-2d78050fd56b8188aa5a65ad2667e301b60eea45.tar.xz
wireshark-2d78050fd56b8188aa5a65ad2667e301b60eea45.zip
Adding upstream version 4.2.4.upstream/4.2.4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--epan/prefs.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/epan/prefs.c b/epan/prefs.c
index 4625ec3d..0d3f0532 100644
--- a/epan/prefs.c
+++ b/epan/prefs.c
@@ -1705,7 +1705,11 @@ range_t* prefs_get_range_value_real(pref_t *pref, pref_source_t source)
range_t* prefs_get_range_value(const char *module_name, const char* pref_name)
{
- return prefs_get_range_value_real(prefs_find_preference(prefs_find_module(module_name), pref_name), pref_current);
+ pref_t *pref = prefs_find_preference(prefs_find_module(module_name), pref_name);
+ if (pref == NULL) {
+ return NULL;
+ }
+ return prefs_get_range_value_real(pref, pref_current);
}
void
@@ -2323,17 +2327,6 @@ pref_clean_stash(pref_t *pref, gpointer unused _U_)
return 0;
}
-#if 0
-/* Return the value assigned to the given uint preference. */
-guint
-prefs_get_uint_preference(pref_t *pref)
-{
- if (pref && pref->type == PREF_UINT)
- return *pref->varp.uint;
- return 0;
-}
-#endif
-
/*
* Call a callback function, with a specified argument, for each preference
* in a given module.
@@ -3369,9 +3362,13 @@ prefs_register_modules(void)
"The maximum number of items that can be added to the dissection tree (Increase with caution)",
10,
&prefs.gui_max_tree_items);
+ /*
+ * Used independently by proto_tree_add_node, call_dissector*, dissector_try_heuristic,
+ * and increment_dissection_depth.
+ */
prefs_register_uint_preference(gui_module, "max_tree_depth",
- "Maximum tree depth",
- "The maximum depth of the dissection tree (Increase with caution)",
+ "Maximum dissection depth",
+ "The maximum depth for dissection tree and protocol layer checks. (Increase with caution)",
10,
&prefs.gui_max_tree_depth);
@@ -4827,7 +4824,11 @@ guint prefs_get_uint_value_real(pref_t *pref, pref_source_t source)
guint prefs_get_uint_value(const char *module_name, const char* pref_name)
{
- return prefs_get_uint_value_real(prefs_find_preference(prefs_find_module(module_name), pref_name), pref_current);
+ pref_t *pref = prefs_find_preference(prefs_find_module(module_name), pref_name);
+ if (pref == NULL) {
+ return 0;
+ }
+ return prefs_get_uint_value_real(pref, pref_current);
}
char* prefs_get_password_value(pref_t *pref, pref_source_t source)