summaryrefslogtreecommitdiff
path: root/wiretap/ngsniffer.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-01-01 23:19:17 +0000
committerGuy Harris <guy@alum.mit.edu>2014-01-01 23:19:17 +0000
commitf878016d6bbd8fe91e57a408c7327ea200967c71 (patch)
tree7178571d44ac930f4171ee9893d879fb908530c9 /wiretap/ngsniffer.c
parent10ebce27dc49a5b3bb596dc0248248b59d337dbe (diff)
downloadwireshark-f878016d6bbd8fe91e57a408c7327ea200967c71.tar.gz
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
Diffstat (limited to 'wiretap/ngsniffer.c')
-rw-r--r--wiretap/ngsniffer.c16
1 files changed, 4 insertions, 12 deletions
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;
}