Add sanity checks to make sure the claimed block size is big enough to:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 22 Feb 2012 18:32:43 +0000 (18:32 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 22 Feb 2012 18:32:43 +0000 (18:32 +0000)
commitf73985b3712c87a3f21cf2fe61e48c14964bc734
treef1b8cca50dc50f2f1086274bd53e6fc33d9de1b3
parent5512f1bc2868f40f67e838f1eadb43f92297866f
Add sanity checks to make sure the claimed block size is big enough to:

1) contain the block length fields and block type field;

2) contain that plus the fixed-length portion of the block;

3) for blocks that have a variable-length portion other than the
   options, contain that variable-length portion.

Fixes a crash we're seeing with a bad pcap-NG file in the Wireshark
menagerie (7799-lastPacketWithoutComment.pcapng - the last packet's
block length is 128, but it claims to have 98 bytes of packet data,
which requires a 132-byte block).

Clean up white space (use 8-space tabs).

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@41143 f5534014-38df-0310-8fa8-9805f1628bb7
wiretap/pcapng.c