mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 18:48:20 +00:00
Fix a couple of Coverity findings (1433618, 1433619)
This commit is contained in:
parent
66eaf9c7cc
commit
ce2b00fe83
2 changed files with 14 additions and 9 deletions
|
@ -681,18 +681,22 @@ bool NetSessions::WantConnection(uint16_t src_port, uint16_t dst_port,
|
||||||
|
|
||||||
void NetSessions::Weird(const char* name, const Packet* pkt, const char* addl)
|
void NetSessions::Weird(const char* name, const Packet* pkt, const char* addl)
|
||||||
{
|
{
|
||||||
|
const char* weird_name = name;
|
||||||
|
|
||||||
if ( pkt )
|
if ( pkt )
|
||||||
|
{
|
||||||
pkt->dump_packet = true;
|
pkt->dump_packet = true;
|
||||||
|
|
||||||
const char* weird_name;
|
|
||||||
if ( pkt->encap && pkt->encap->LastType() != BifEnum::Tunnel::NONE )
|
if ( pkt->encap && pkt->encap->LastType() != BifEnum::Tunnel::NONE )
|
||||||
weird_name = util::fmt("%s_in_tunnel", name);
|
weird_name = util::fmt("%s_in_tunnel", name);
|
||||||
else
|
|
||||||
weird_name = name;
|
|
||||||
|
|
||||||
if ( pkt->ip_hdr )
|
if ( pkt->ip_hdr )
|
||||||
|
{
|
||||||
reporter->Weird(pkt->ip_hdr->SrcAddr(), pkt->ip_hdr->DstAddr(), weird_name, addl);
|
reporter->Weird(pkt->ip_hdr->SrcAddr(), pkt->ip_hdr->DstAddr(), weird_name, addl);
|
||||||
else
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
reporter->Weird(weird_name, addl);
|
reporter->Weird(weird_name, addl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ IPAnalyzer::IPAnalyzer()
|
||||||
|
|
||||||
IPAnalyzer::~IPAnalyzer()
|
IPAnalyzer::~IPAnalyzer()
|
||||||
{
|
{
|
||||||
|
delete discarder;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPAnalyzer::AnalyzePacket(size_t len, const uint8_t* data, Packet* packet)
|
bool IPAnalyzer::AnalyzePacket(size_t len, const uint8_t* data, Packet* packet)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue