Fix crash when switching profiles

rescan_packets() starts a new dissection session by free'ing the
previous state and creating a new one. A reference to the old session
was not updated though.

This is the only place where epan is overwritten. After init, col_init
will at some point initialize cf->cinfo.epan with a cf->epan.

Bug: 9463
Change-Id: I8cf4e0823328f44a0dccfeeec1594f9929829d2d
Reviewed-on: https://code.wireshark.org/review/1430
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
This commit is contained in:
Peter Wu 2014-04-29 15:47:09 +02:00 committed by Alexis La Goutte
parent b60ccf6dae
commit dfb92dfd67
1 changed files with 1 additions and 0 deletions

1
file.c
View File

@ -1890,6 +1890,7 @@ rescan_packets(capture_file *cf, const char *action, const char *action_item, gb
/* 'reset' dissection session */
epan_free(cf->epan);
cf->epan = ws_epan_new(cf);
cf->cinfo.epan = cf->epan;
/* We need to redissect the packets so we have to discard our old
* packet list store. */