forked from osmocom/wireshark
If stuff above the Wiretap library can't handle packet reported lengths
> WTAP_MAX_PACKET_SIZE, either that should be caught above the per-file-type layer in Wiretap or should be handled by the caller. We've recently fixed at least one problem with reported lengths > 2^31 - 1 (by clamping the length to 2^31 - 1), so let's just remove the check from the pcap-NG reader, to squelch some complaints we're getting from the buildbot (bug 6673 and its duplicates). (The pcap reader uses it to cope with some of the botched libpcap formats that changed the per-packet header without changing the magic number; I'll look at trying to preserve those heuristics while still allowing reported lengths > WTAP_MAX_PACKET_SIZE.) svn path=/trunk/; revision=40207
This commit is contained in:
parent
e97991cdcc
commit
ab910e4cff
|
@ -852,12 +852,6 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t *pn, wta
|
|||
wblock->data.packet.packet_len,
|
||||
wblock->data.packet.cap_len,
|
||||
wblock->data.packet.interface_id);
|
||||
if (wblock->data.packet.packet_len > WTAP_MAX_PACKET_SIZE) {
|
||||
*err = WTAP_ERR_BAD_FILE;
|
||||
*err_info = g_strdup_printf("pcapng_read_packet_block: packet_len %u is larger than WTAP_MAX_PACKET_SIZE %u.",
|
||||
wblock->data.packet.packet_len, WTAP_MAX_PACKET_SIZE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
wtap_encap = pcapng_get_encap(wblock->data.packet.interface_id, pn);
|
||||
pcapng_debug3("pcapng_read_packet_block: encapsulation = %d (%s), pseudo header size = %d.",
|
||||
|
@ -1029,12 +1023,6 @@ pcapng_read_simple_packet_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t *
|
|||
}
|
||||
pcapng_debug1("pcapng_read_simple_packet_block: packet data: packet_len %u",
|
||||
wblock->data.simple_packet.packet_len);
|
||||
if (wblock->data.simple_packet.packet_len > WTAP_MAX_PACKET_SIZE) {
|
||||
*err = WTAP_ERR_BAD_FILE;
|
||||
*err_info = g_strdup_printf("pcapng_read_simple_packet_block: packet_len %u is larger than WTAP_MAX_PACKET_SIZE %u.",
|
||||
wblock->data.simple_packet.packet_len, WTAP_MAX_PACKET_SIZE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
encap = pcapng_get_encap(0, pn);
|
||||
pcapng_debug1("pcapng_read_simple_packet_block: Need to read pseudo header of size %d",
|
||||
|
|
Loading…
Reference in New Issue