aboutsummaryrefslogtreecommitdiffstats
path: root/tshark.c
diff options
context:
space:
mode:
authorAdam Morrison <adammo@extrahop.com>2018-06-04 13:22:49 -0700
committerAnders Broman <a.broman58@gmail.com>2018-08-22 06:18:11 +0000
commit11b3663004dfebb6976b1e416b6aa70e96a743c8 (patch)
tree5c26f2b888ae83f73151b15018e8f0609404437f /tshark.c
parentbb25d64a2a240dcfd6469d5e389a996f7a4637d7 (diff)
Fixed a bug related to epan initialization
In various places, <program>_epan_new was called before setting the provider, so the wth field was null. This fix is necessary for the next commit, adding Secrets Description Block, as it uses this field. Change-Id: Ice8ee01c56b3e04fc71d7b2c659d9635cb366951 Reviewed-on: https://code.wireshark.org/review/28868 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'tshark.c')
-rw-r--r--tshark.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/tshark.c b/tshark.c
index bcbe68530d..4b5f451653 100644
--- a/tshark.c
+++ b/tshark.c
@@ -4064,10 +4064,6 @@ cf_open(capture_file *cf, const char *fname, unsigned int type, gboolean is_temp
/* The open succeeded. Fill in the information for this file. */
- /* Create new epan session for dissection. */
- epan_free(cf->epan);
- cf->epan = tshark_epan_new(cf);
-
cf->provider.wth = wth;
cf->f_datalen = 0; /* not used, but set it anyway */
@@ -4093,7 +4089,9 @@ cf_open(capture_file *cf, const char *fname, unsigned int type, gboolean is_temp
cf->provider.prev_dis = NULL;
cf->provider.prev_cap = NULL;
- cf->state = FILE_READ_IN_PROGRESS;
+ /* Create new epan session for dissection. */
+ epan_free(cf->epan);
+ cf->epan = tshark_epan_new(cf);
wtap_set_cb_new_ipv4(cf->provider.wth, add_ipv4_name);
wtap_set_cb_new_ipv6(cf->provider.wth, (wtap_new_ipv6_callback_t) add_ipv6_name);