summaryrefslogtreecommitdiff
path: root/epan
diff options
context:
space:
mode:
authorMartin Kaiser <wireshark@kaiser.cx>2017-06-23 18:09:38 -0400
committerMichael Mann <mmann78@netscape.net>2017-06-24 10:33:18 +0000
commitbb20b159f35455c41a8f077724f685508e0823b6 (patch)
tree885754b0a1f4b8407f2545cb133e85d934c8a601 /epan
parentd8710f4aa4e25753130b534b7b8a99601df472dd (diff)
downloadwireshark-bb20b159f35455c41a8f077724f685508e0823b6.tar.gz
addr_types: replace DISSECTOR_ASSERT() with g_assert()
DISSECTOR_ASSERT() can be used only when we're in wmem packet scope. It cannot be used during startup when address types are registered. In those cases, we must use g_assert(). If we still use DISSECTOR_ASSERT() and an assert is hit, we'll see a wmem assertion ** ERROR:../epan/wmem/wmem_core.c:52:wmem_alloc: assertion failed: (allocator->in_scope) Aborted instead of the actual assert output. Change-Id: Ife12ca3455d56ba4faa2dd6034df8a091d8641ed Reviewed-on: https://code.wireshark.org/review/22378 Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan')
-rw-r--r--epan/address_types.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/epan/address_types.c b/epan/address_types.c
index 56e9d227e6..2441e278a4 100644
--- a/epan/address_types.c
+++ b/epan/address_types.c
@@ -73,11 +73,11 @@ static void address_type_register(int addr_type, address_type_t *at)
g_assert(type_list[addr_type] == NULL);
/* Sanity check */
- DISSECTOR_ASSERT(at->name);
- DISSECTOR_ASSERT(at->pretty_name);
- DISSECTOR_ASSERT(at->addr_to_str);
- DISSECTOR_ASSERT(at->addr_str_len);
- DISSECTOR_ASSERT(((at->addr_name_res_str != NULL) && (at->addr_name_res_len != NULL)) ||
+ g_assert(at->name);
+ g_assert(at->pretty_name);
+ g_assert(at->addr_to_str);
+ g_assert(at->addr_str_len);
+ g_assert(((at->addr_name_res_str != NULL) && (at->addr_name_res_len != NULL)) ||
((at->addr_name_res_str == NULL) && (at->addr_name_res_len == NULL)));
type_list[addr_type] = at;
@@ -91,16 +91,16 @@ int address_type_dissector_register(const char* name, const char* pretty_name,
int addr_type;
/* Ensure valid data/functions for required fields */
- DISSECTOR_ASSERT(name);
- DISSECTOR_ASSERT(pretty_name);
- DISSECTOR_ASSERT(to_str_func);
- DISSECTOR_ASSERT(str_len_func);
+ g_assert(name);
+ g_assert(pretty_name);
+ g_assert(to_str_func);
+ g_assert(str_len_func);
/* Either have both or neither */
- DISSECTOR_ASSERT(((name_res_str_func != NULL) && (name_res_len_func != NULL)) ||
+ g_assert(((name_res_str_func != NULL) && (name_res_len_func != NULL)) ||
((name_res_str_func == NULL) && (name_res_len_func == NULL)));
/* This shouldn't happen, so flag it for fixing */
- DISSECTOR_ASSERT(num_dissector_addr_type < MAX_DISSECTOR_ADDR_TYPE);
+ g_assert(num_dissector_addr_type < MAX_DISSECTOR_ADDR_TYPE);
addr_type = AT_END_OF_LIST+num_dissector_addr_type;
dissector_type_addresses[num_dissector_addr_type].addr_type = addr_type;