Hi,
If you call plugin_if_goto_frame when there is no capture file loaded you get an Protection Exception in cf_goto_frame (in file.c).
The code is:
gboolean
cf_goto_frame(capture_file *cf, guint fnumber)
{
frame_data *fdata;
fdata = frame_data_sequence_find(cf->frames, fnumber); // *** problem occurs here as cf is NULL
if (fdata == NULL) {
/* we didn't find a packet with that packet number */
statusbar_push_temporary_msg("There is no packet number %u.", fnumber);
The problem can be avoided by changing the code to this:
gboolean
cf_goto_frame(capture_file *cf, guint fnumber)
{
frame_data *fdata;
if (cf == NULL) {
/* we don't have a loaded capture file */
statusbar_push_temporary_msg("There is no file loaded");
return FALSE; /* we failed to go to that packet */
}
else
{
fdata = frame_data_sequence_find(cf->frames, fnumber);
}
if (fdata == NULL) {
/* we didn't find a packet with that packet number */
statusbar_push_temporary_msg("There is no packet number %u.", fnumber);
.
.
I’ve tested the above and it seems to work OK.
Is this acceptable to be reported as a bug or is the view that I should have checked there was a capture file loaded before I made the call?
Thanks and regards…Paul