diff options
author | Guy Harris <guy@alum.mit.edu> | 2013-09-28 18:25:07 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2013-09-28 18:25:07 +0000 |
commit | bdd237863ff73e5c03de87e592e1de67a062eba5 (patch) | |
tree | d77699887ed47698de4c83309cb2dbbc0c7063f5 /wiretap | |
parent | a582b7201ae75b15ba8e9ce600a33c0ec0737003 (diff) |
Correctly calculate the captured length in a Simple Packet Block -
subtract out the minimum SPB size, which includes the length of
*everything* except for the packet data.
Fixes one problem found by the file in bug 9200.
svn path=/trunk/; revision=52244
Diffstat (limited to 'wiretap')
-rw-r--r-- | wiretap/pcapng.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/wiretap/pcapng.c b/wiretap/pcapng.c index b0fc3c2dc9..68fb40e34c 100644 --- a/wiretap/pcapng.c +++ b/wiretap/pcapng.c @@ -1335,9 +1335,7 @@ pcapng_read_simple_packet_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t * wblock->data.simple_packet.packet_len = spb.packet_len; } - wblock->data.simple_packet.cap_len = bh->block_total_length - - (guint32)sizeof(pcapng_simple_packet_block_t) - - (guint32)sizeof(bh->block_total_length); + wblock->data.simple_packet.cap_len = bh->block_total_length - MIN_SPB_SIZE; if (wblock->data.simple_packet.cap_len > wblock->data.simple_packet.packet_len) wblock->data.simple_packet.cap_len = wblock->data.simple_packet.packet_len; |