diff --git a/CHANGES b/CHANGES index beadb32a63..7c7da83804 100644 --- a/CHANGES +++ b/CHANGES @@ -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 * Fix checking of fwrite return values (Johanna Amann) diff --git a/VERSION b/VERSION index a24ec6faab..b62bade18f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.3-263 +2.3-264 diff --git a/src/Flare.cc b/src/Flare.cc index dcb5fa2c1f..5df6d663aa 100644 --- a/src/Flare.cc +++ b/src/Flare.cc @@ -22,7 +22,7 @@ static void bad_pipe_op(const char* which) void Flare::Fire() { - char tmp; + char tmp = 0; for ( ; ; ) { diff --git a/src/iosource/PktSrc.cc b/src/iosource/PktSrc.cc index eaf85bbfa4..527dadd393 100644 --- a/src/iosource/PktSrc.cc +++ b/src/iosource/PktSrc.cc @@ -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)); Close(); + return false; } if ( code->MatchesAnything() ) diff --git a/src/iosource/PktSrc.h b/src/iosource/PktSrc.h index 9c05115257..7137798129 100644 --- a/src/iosource/PktSrc.h +++ b/src/iosource/PktSrc.h @@ -266,7 +266,11 @@ protected: Properties() { + selectable_fd = -1; + link_type = -1; + hdr_size = -1; netmask = PCAP_NETMASK_UNKNOWN; + is_live = false; } }; diff --git a/src/iosource/pcap/Source.cc b/src/iosource/pcap/Source.cc index e96933aaa6..72b19b2f14 100644 --- a/src/iosource/pcap/Source.cc +++ b/src/iosource/pcap/Source.cc @@ -21,6 +21,9 @@ PcapSource::PcapSource(const std::string& path, bool is_live) { props.path = path; props.is_live = is_live; + pd = 0; + memset(¤t_hdr, 0, sizeof(current_hdr)); + memset(&last_hdr, 0, sizeof(last_hdr)); last_data = 0; }