diff options
author | Peter Wu <peter@lekensteyn.nl> | 2018-06-26 16:12:37 -0700 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-06-27 03:20:09 +0000 |
commit | 910bc034abd8e5209dc6ccd8cacdafdc59b1c9dc (patch) | |
tree | 87c227f6bbf1f3168b75e29a18259eaf9cb232f2 /plugins/epan | |
parent | e94553167c61e50011a99c0b3bf332158aeaeed0 (diff) |
TRANSUM: fix crash when switching profiles
"output_rrpd" is NULL when the TRANSUM dissector is disabled (which is
the default behavior). When switching to a profile where the dissector
is enabled, redissection happens, but without invoking the init routine.
This leads to a crash when dissect_transum tries to query "output_rrpd".
Fix this by creating the map unconditionally. Use wmem_map_new_autoreset
since its contents should be erased for new capture files.
Bug: 13697
Change-Id: Iea897da8faf8042dffdc74327d9d1221e5fb155f
Fixes: v2.3.0rc0-1887-g78d56e5dd7 ("Cleanup transum post-dissector.")
Reviewed-on: https://code.wireshark.org/review/28474
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'plugins/epan')
-rw-r--r-- | plugins/epan/transum/packet-transum.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/epan/transum/packet-transum.c b/plugins/epan/transum/packet-transum.c index e2dd054d71..0fdb8fb4cc 100644 --- a/plugins/epan/transum/packet-transum.c +++ b/plugins/epan/transum/packet-transum.c @@ -801,8 +801,6 @@ static void init_globals(void) wmem_map_insert(preferences.tcp_svc_ports, GUINT_TO_POINTER(445), GUINT_TO_POINTER(RTE_CALC_SMB2)); wmem_map_insert(preferences.udp_svc_ports, GUINT_TO_POINTER(53), GUINT_TO_POINTER(RTE_CALC_DNS)); - - output_rrpd = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal); } /* Undo capture file-specific initializations. */ @@ -1335,6 +1333,8 @@ proto_register_transum(void) register_cleanup_routine(cleanup_globals); register_postdissector(transum_handle); + + output_rrpd = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), g_direct_hash, g_direct_equal); } void proto_reg_handoff_transum(void) |