From f15bc8f78eae74bca57ebf7063b6a7b1979c5c08 Mon Sep 17 00:00:00 2001 From: Paul Offord Date: Sun, 29 Nov 2015 22:49:46 +0000 Subject: Fix to avoid protection exception in cf_goto_frame A call to plugin_if_goto_frame when there is no capture file loaded causes a protection exception in cf_goto_file. This fix avoids that problem. Bug: 11810 Change-Id: I7e6f31690a4b0d8d4252b41d8d438979cb253050 Reviewed-on: https://code.wireshark.org/review/12306 Reviewed-by: Alexis La Goutte Petri-Dish: Alexis La Goutte Reviewed-by: Roland Knall Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- file.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'file.c') diff --git a/file.c b/file.c index 9c0ff8e709..b3b9fdf96a 100644 --- a/file.c +++ b/file.c @@ -3474,6 +3474,12 @@ cf_goto_frame(capture_file *cf, guint fnumber) { frame_data *fdata; + if (cf == NULL) { + /* we don't have a loaded capture file - fix for bug 11810*/ + statusbar_push_temporary_msg("There is no file loaded"); + return FALSE; /* we failed to go to that packet */ + } + fdata = frame_data_sequence_find(cf->frames, fnumber); if (fdata == NULL) { -- cgit v1.2.3