diff --git a/wiretap/netscreen.c b/wiretap/netscreen.c index 947cc8a533..80ef74cc19 100644 --- a/wiretap/netscreen.c +++ b/wiretap/netscreen.c @@ -208,8 +208,8 @@ static gboolean netscreen_read(wtap *wth, int *err, gchar **err_info, return FALSE; /* Parse the header */ - pkt_len = parse_netscreen_rec_hdr(&wth->phdr, line, cap_int, &cap_dir, cap_dst, - err, err_info); + pkt_len = parse_netscreen_rec_hdr(&wth->phdr, line, cap_int, &cap_dir, + cap_dst, err, err_info); if (pkt_len == -1) return FALSE; @@ -241,9 +241,10 @@ static gboolean netscreen_read(wtap *wth, int *err, gchar **err_info, /* Used to read packets in random-access fashion */ static gboolean netscreen_seek_read(wtap *wth, gint64 seek_off, - struct wtap_pkthdr *phdr, Buffer *buf, int len, + struct wtap_pkthdr *phdr, Buffer *buf, int len _U_, int *err, gchar **err_info) { + int pkt_len; char line[NETSCREEN_LINE_LENGTH]; char cap_int[NETSCREEN_MAX_INT_NAME_LENGTH]; gboolean cap_dir; @@ -261,13 +262,13 @@ netscreen_seek_read(wtap *wth, gint64 seek_off, return FALSE; } - if (parse_netscreen_rec_hdr(phdr, line, cap_int, &cap_dir, cap_dst, - err, err_info) == -1) { + pkt_len = parse_netscreen_rec_hdr(phdr, line, cap_int, &cap_dir, + cap_dst, err, err_info); + if (pkt_len == -1) return FALSE; - } - if (!parse_netscreen_hex_dump(wth->random_fh, len, cap_int, cap_dst, - phdr, buf, err, err_info)) + if (!parse_netscreen_hex_dump(wth->random_fh, pkt_len, cap_int, + cap_dst, phdr, buf, err, err_info)) return FALSE; return TRUE; }