diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2015-12-13 21:42:54 +0100 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2015-12-13 20:48:16 +0000 |
commit | 260704695dff7db0b0b2432d3b0cdc8512888f70 (patch) | |
tree | a34b27aa07bc6c68996209ec99c905f3f33e1450 /epan | |
parent | 4b6d9a7927c612014518c6bbda82611213ac4132 (diff) |
Fix crash at startup
Change-Id: I6d21fb06ace6186991f4e481bfc7452364e6c4f7
Reviewed-on: https://code.wireshark.org/review/12602
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/capture_dissectors.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/capture_dissectors.c b/epan/capture_dissectors.c index 45f65e5239..738bacbc90 100644 --- a/epan/capture_dissectors.c +++ b/epan/capture_dissectors.c @@ -38,7 +38,7 @@ static GHashTable *registered_capture_dissectors = NULL; void capture_dissector_init(void) { - registered_capture_dissectors = g_hash_table_new_full(g_int_hash, g_int_equal, NULL, NULL); + registered_capture_dissectors = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, NULL); } void capture_dissector_cleanup(void) @@ -52,19 +52,19 @@ void register_capture_dissector(gint linktype, capture_dissector_t dissector, co struct capture_dissector_handle *handle; /* Make sure the registration is unique */ - g_assert(g_hash_table_lookup(registered_capture_dissectors, &linktype) == NULL); + g_assert(g_hash_table_lookup(registered_capture_dissectors, GUINT_TO_POINTER(linktype)) == NULL); handle = wmem_new(wmem_epan_scope(), struct capture_dissector_handle); handle->linktype = linktype; handle->dissector = dissector; handle->protocol = find_protocol_by_id(proto); - g_hash_table_insert(registered_capture_dissectors, (gpointer)&linktype, (gpointer) handle); + g_hash_table_insert(registered_capture_dissectors, GUINT_TO_POINTER(linktype), (gpointer) handle); } void call_capture_dissector(gint linktype, const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header) { - struct capture_dissector_handle* handle = (struct capture_dissector_handle *)g_hash_table_lookup(registered_capture_dissectors, &linktype); + struct capture_dissector_handle* handle = (struct capture_dissector_handle *)g_hash_table_lookup(registered_capture_dissectors, GUINT_TO_POINTER(linktype)); if (handle == NULL) return; |