mirror of
https://github.com/zeek/zeek.git
synced 2025-10-11 19:18:19 +00:00
Add a check for null packet data in pcap IOSource
Some libpcaps (observed in Myricom's) may claim to have read a packet, but either did not really read a packet or at least provide no way to access its contents, so this adds a check for null-data to handle those cases.
This commit is contained in:
parent
25dcf210b1
commit
77cf68fda7
1 changed files with 8 additions and 0 deletions
|
@ -220,6 +220,14 @@ bool PcapSource::ExtractNextPacket(Packet* pkt)
|
|||
return false;
|
||||
case 1:
|
||||
// Read a packet without problem.
|
||||
// Although, some libpcaps may claim to have read a packet, but either did
|
||||
// not really read a packet or at least provide no way to access its
|
||||
// contents, so the following check for null-data helps handle those cases.
|
||||
if ( ! data )
|
||||
{
|
||||
reporter->Weird("pcap_null_data_packet");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
reporter->InternalError("unhandled pcap_next_ex return value: %d", res);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue