From f878016d6bbd8fe91e57a408c7327ea200967c71 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 1 Jan 2014 23:19:17 +0000 Subject: Back out r54523 - more work is needed on it, and some testing found an unrelated uninitialized-data bug that I want to fix in the next commit, and then backport. svn path=/trunk/; revision=54543 --- wiretap/ngsniffer.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'wiretap/ngsniffer.c') diff --git a/wiretap/ngsniffer.c b/wiretap/ngsniffer.c index cc86c1074f..9c18623504 100644 --- a/wiretap/ngsniffer.c +++ b/wiretap/ngsniffer.c @@ -1224,18 +1224,10 @@ found: /* * Read the packet data. */ - if (!ngsniffer_read_rec_data(wth, FALSE, wth->frame_buffer, size, + if (!ngsniffer_read_rec_data(wth, FALSE, wth->frame_buffer, length, err, err_info)) return FALSE; /* Read error */ - /* - * Skip any extra data in the record. - */ - if (size < length) { - if (!ng_file_skip_seq(wth, length - size, err, err_info)) - return FALSE; - } - wth->phdr.pkt_encap = fix_pseudo_header(wth->file_encap, wth->frame_buffer, length, &wth->phdr.pseudo_header); @@ -1274,7 +1266,7 @@ found: static gboolean ngsniffer_seek_read(wtap *wth, gint64 seek_off, - struct wtap_pkthdr *phdr, Buffer *buf, int packet_size _U_, + struct wtap_pkthdr *phdr, Buffer *buf, int packet_size, int *err, gchar **err_info) { union wtap_pseudo_header *pseudo_header = &phdr->pseudo_header; @@ -1347,10 +1339,10 @@ ngsniffer_seek_read(wtap *wth, gint64 seek_off, /* * Got the pseudo-header (if any), now get the data. */ - if (!ngsniffer_read_rec_data(wth, TRUE, buf, phdr->caplen, err, err_info)) + if (!ngsniffer_read_rec_data(wth, TRUE, buf, packet_size, err, err_info)) return FALSE; - fix_pseudo_header(wth->file_encap, buf, phdr->caplen, pseudo_header); + fix_pseudo_header(wth->file_encap, buf, packet_size, pseudo_header); return TRUE; } -- cgit v1.2.1