From eeda7ec1aea880f1ee951d1b3188693d88a98b55 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 31 Dec 2013 23:32:30 +0000 Subject: Use the packet length read from the packet header when reading packets randomly. svn path=/trunk/; revision=54519 --- wiretap/netmon.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'wiretap/netmon.c') diff --git a/wiretap/netmon.c b/wiretap/netmon.c index 7ec1668693..bf5eec3cee 100644 --- a/wiretap/netmon.c +++ b/wiretap/netmon.c @@ -748,7 +748,7 @@ again: static gboolean netmon_seek_read(wtap *wth, gint64 seek_off, - struct wtap_pkthdr *phdr, Buffer *buf, int length, + struct wtap_pkthdr *phdr, Buffer *buf, int length _U_, int *err, gchar **err_info) { netmon_t *netmon = (netmon_t *)wth->priv; @@ -763,7 +763,8 @@ netmon_seek_read(wtap *wth, gint64 seek_off, /* * Read the packet data. */ - if (!wtap_read_packet_bytes(wth->random_fh, buf, length, err, err_info)) + if (!wtap_read_packet_bytes(wth->random_fh, buf, phdr->caplen, err, + err_info)) return FALSE; /* -- cgit v1.2.3