diff options
author | Guy Harris <guy@alum.mit.edu> | 2003-09-03 23:32:40 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2003-09-03 23:32:40 +0000 |
commit | d7c622e309d0b2a40c2df87c66765062631377ab (patch) | |
tree | ec76a902733fdaa078a61a7f3f94ff7848782635 /gtk | |
parent | 4a4d2dcf7ea2c19d9bc66067414322f13b7741d4 (diff) |
Check for "wtap_seek_read()" failing.
svn path=/trunk/; revision=8364
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/main.c | 11 | ||||
-rw-r--r-- | gtk/tap_rtp.c | 8 | ||||
-rw-r--r-- | gtk/tcp_graph.c | 11 |
3 files changed, 21 insertions, 9 deletions
diff --git a/gtk/main.c b/gtk/main.c index 8cbe7080eb..9bfa5f1079 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1,6 +1,6 @@ /* main.c * - * $Id: main.c,v 1.308 2003/09/03 10:49:03 sahlberg Exp $ + * $Id: main.c,v 1.309 2003/09/03 23:32:40 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -470,9 +470,12 @@ get_text_from_packet_list(gpointer data) int err; if (fdata != NULL) { - /* XXX - do something with "err" */ - wtap_seek_read(cfile.wth, fdata->file_off, &cfile.pseudo_header, - cfile.pd, fdata->cap_len, &err); + if (!wtap_seek_read(cfile.wth, fdata->file_off, &cfile.pseudo_header, + cfile.pd, fdata->cap_len, &err)) { + simple_dialog(ESD_TYPE_CRIT, NULL, + file_read_error_message(err), cfile.filename); + return NULL; + } edt = epan_dissect_new(FALSE, FALSE); epan_dissect_run(edt, &cfile.pseudo_header, cfile.pd, fdata, diff --git a/gtk/tap_rtp.c b/gtk/tap_rtp.c index d015e5b3b1..b0ddfeb44d 100644 --- a/gtk/tap_rtp.c +++ b/gtk/tap_rtp.c @@ -1,7 +1,7 @@ /* * tap_rtp.c * - * $Id: tap_rtp.c,v 1.13 2003/05/28 01:09:57 gerald Exp $ + * $Id: tap_rtp.c,v 1.14 2003/09/03 23:32:40 guy Exp $ * * RTP analysing addition for ethereal * @@ -1239,7 +1239,11 @@ static void rtp_analyse_cb(GtkWidget *w _U_, gpointer data _U_) /* XXX instead of looking for RTP protocol like this, we could do the process_node() staff */ /* dissect the current frame */ - wtap_seek_read(cf->wth, fdata->file_off, &cf->pseudo_header, cf->pd, fdata->cap_len, &err); + if (!wtap_seek_read(cf->wth, fdata->file_off, &cf->pseudo_header, cf->pd, fdata->cap_len, &err)) { + simple_dialog(ESD_TYPE_CRIT, NULL, + file_read_error_message(err), cf->filename); + return; + } edt = epan_dissect_new(TRUE, FALSE); epan_dissect_prime_dfilter(edt, sfcode); epan_dissect_run(edt, &cf->pseudo_header, cf->pd, fdata, &cf->cinfo); diff --git a/gtk/tcp_graph.c b/gtk/tcp_graph.c index 7ad8bf668c..9d5539e55f 100644 --- a/gtk/tcp_graph.c +++ b/gtk/tcp_graph.c @@ -3,7 +3,7 @@ * By Pavel Mores <pvl@uh.cz> * Win32 port: rwh@unifiedtech.com * - * $Id: tcp_graph.c,v 1.33 2003/08/18 18:41:25 guy Exp $ + * $Id: tcp_graph.c,v 1.34 2003/09/03 23:32:40 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1791,8 +1791,13 @@ static void graph_segment_list_get (struct graph *g) for (ptr=cfile.plist; ptr; ptr=ptr->next) { /* XXX - do something with "err" */ - wtap_seek_read (cfile.wth, ptr->file_off, &pseudo_header, - pd, ptr->cap_len, &err); + if (!wtap_seek_read (cfile.wth, ptr->file_off, &pseudo_header, + pd, ptr->cap_len, &err)) { + simple_dialog(ESD_TYPE_CRIT, NULL, + file_read_error_message(err), + cfile.filename); + break; + } if (!segment) segment = (struct segment * )malloc (sizeof (struct segment)); if (!segment) |