Fix some minor Coverity Scan complaints.

This commit is contained in:
Jon Siwek 2014-10-30 13:25:29 -05:00
parent 432744fde4
commit dec96234e3
6 changed files with 14 additions and 2 deletions

View file

@ -1,4 +1,8 @@
2.3-264 | 2014-10-30 13:25:57 -0500
* Fix some minor Coverity Scan complaints. (Jon Siwek)
2.3-263 | 2014-10-28 15:09:10 -0500 2.3-263 | 2014-10-28 15:09:10 -0500
* Fix checking of fwrite return values (Johanna Amann) * Fix checking of fwrite return values (Johanna Amann)

View file

@ -1 +1 @@
2.3-263 2.3-264

View file

@ -22,7 +22,7 @@ static void bad_pipe_op(const char* which)
void Flare::Fire() void Flare::Fire()
{ {
char tmp; char tmp = 0;
for ( ; ; ) for ( ; ; )
{ {

View file

@ -506,6 +506,7 @@ bool PktSrc::ApplyBPFFilter(int index, const struct pcap_pkthdr *hdr, const u_ch
{ {
Error(fmt("BPF filter %d not compiled", index)); Error(fmt("BPF filter %d not compiled", index));
Close(); Close();
return false;
} }
if ( code->MatchesAnything() ) if ( code->MatchesAnything() )

View file

@ -266,7 +266,11 @@ protected:
Properties() Properties()
{ {
selectable_fd = -1;
link_type = -1;
hdr_size = -1;
netmask = PCAP_NETMASK_UNKNOWN; netmask = PCAP_NETMASK_UNKNOWN;
is_live = false;
} }
}; };

View file

@ -21,6 +21,9 @@ PcapSource::PcapSource(const std::string& path, bool is_live)
{ {
props.path = path; props.path = path;
props.is_live = is_live; props.is_live = is_live;
pd = 0;
memset(&current_hdr, 0, sizeof(current_hdr));
memset(&last_hdr, 0, sizeof(last_hdr));
last_data = 0; last_data = 0;
} }