Fix uninitialized (or unused) fields.

This commit is contained in:
Jon Siwek 2013-09-27 10:13:52 -05:00
parent 64f3bef96d
commit 775ec6795e
62 changed files with 135 additions and 98 deletions

View file

@ -147,7 +147,9 @@ void AnonymizeIPAddr_A50::init()
special_nodes[0].input = special_nodes[0].output = 0; special_nodes[0].input = special_nodes[0].output = 0;
special_nodes[1].input = special_nodes[1].output = 0xFFFFFFFF; special_nodes[1].input = special_nodes[1].output = 0xFFFFFFFF;
method = 0;
before_anonymization = 1; before_anonymization = 1;
new_mapping = 0;
} }
int AnonymizeIPAddr_A50::PreservePrefix(ipaddr32_t input, int num_bits) int AnonymizeIPAddr_A50::PreservePrefix(ipaddr32_t input, int num_bits)

View file

@ -96,7 +96,7 @@ public:
bool operator==(const Attributes& other) const; bool operator==(const Attributes& other) const;
protected: protected:
Attributes() { type = 0; attrs = 0; } Attributes() : type(), attrs(), in_record() { }
void CheckAttr(Attr* attr); void CheckAttr(Attr* attr);
DECLARE_SERIAL(Attributes); DECLARE_SERIAL(Attributes);

View file

@ -58,9 +58,8 @@ int pcap_compile_nopcap(int snaplen_arg, int linktype_arg,
} }
#endif #endif
BPF_Program::BPF_Program() BPF_Program::BPF_Program() : m_compiled(), m_program()
{ {
m_compiled = false;
} }
BPF_Program::~BPF_Program() BPF_Program::~BPF_Program()

View file

@ -14,9 +14,8 @@
#include "NetVar.h" #include "NetVar.h"
#include "RemoteSerializer.h" #include "RemoteSerializer.h"
ChunkedIO::ChunkedIO() ChunkedIO::ChunkedIO() : stats(), tag(), pure()
{ {
pure = false;
} }
void ChunkedIO::Stats(char* buffer, int length) void ChunkedIO::Stats(char* buffer, int length)
@ -656,6 +655,7 @@ SSL_CTX* ChunkedIOSSL::ctx;
ChunkedIOSSL::ChunkedIOSSL(int arg_socket, bool arg_server) ChunkedIOSSL::ChunkedIOSSL(int arg_socket, bool arg_server)
{ {
socket = arg_socket; socket = arg_socket;
last_ret = 0;
eof = false; eof = false;
setup = false; setup = false;
server = arg_server; server = arg_server;

View file

@ -292,8 +292,9 @@ private:
// Wrapper class around a another ChunkedIO which the (un-)compresses data. // Wrapper class around a another ChunkedIO which the (un-)compresses data.
class CompressedChunkedIO : public ChunkedIO { class CompressedChunkedIO : public ChunkedIO {
public: public:
CompressedChunkedIO(ChunkedIO* arg_io) CompressedChunkedIO(ChunkedIO* arg_io) // takes ownership
: io(arg_io) {} // takes ownership : io(arg_io), zin(), zout(), error(), compress(), uncompress(),
uncompressed_bytes_read(), uncompressed_bytes_written() {}
virtual ~CompressedChunkedIO() { delete io; } virtual ~CompressedChunkedIO() { delete io; }
virtual bool Init(); // does *not* call arg_io->Init() virtual bool Init(); // does *not* call arg_io->Init()

View file

@ -11,6 +11,7 @@ CompositeHash::CompositeHash(TypeList* composite_type)
{ {
type = composite_type; type = composite_type;
Ref(type); Ref(type);
singleton_tag = TYPE_INTERNAL_ERROR;
// If the only element is a record, don't treat it as a // If the only element is a record, don't treat it as a
// singleton, since it needs to be evaluated specially. // singleton, since it needs to be evaluated specially.

View file

@ -141,6 +141,7 @@ Connection::Connection(NetSessions* s, HashKey* k, double t, const ConnID* id,
suppress_event = 0; suppress_event = 0;
record_contents = record_packets = 1; record_contents = record_packets = 1;
record_current_packet = record_current_content = 0;
timers_canceled = 0; timers_canceled = 0;
inactivity_timeout = 0; inactivity_timeout = 0;

View file

@ -20,6 +20,7 @@ DFA_State::DFA_State(int arg_state_num, const EquivClass* ec,
nfa_states = arg_nfa_states; nfa_states = arg_nfa_states;
accept = arg_accept; accept = arg_accept;
mark = 0; mark = 0;
centry = 0;
SymPartition(ec); SymPartition(ec);

View file

@ -47,8 +47,14 @@ extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
class DNS_Mgr_Request { class DNS_Mgr_Request {
public: public:
DNS_Mgr_Request(const char* h, int af, bool is_txt) DNS_Mgr_Request(const char* h, int af, bool is_txt)
{ host = copy_string(h); fam = af; qtype = is_txt ? 16 : 0; } : host(copy_string(h)), fam(af), qtype(is_txt ? 16 : 0), addr(),
DNS_Mgr_Request(const IPAddr& a) { addr = a; host = 0; fam = 0; } request_pending()
{ }
DNS_Mgr_Request(const IPAddr& a)
: host(), fam(), qtype(), addr(a), request_pending()
{ }
~DNS_Mgr_Request() { delete [] host; } ~DNS_Mgr_Request() { delete [] host; }
// Returns nil if this was an address request. // Returns nil if this was an address request.
@ -192,6 +198,8 @@ DNS_Mapping::DNS_Mapping(FILE* f)
init_failed = 1; init_failed = 1;
req_host = 0; req_host = 0;
req_ttl = 0;
creation_time = 0;
char buf[512]; char buf[512];

View file

@ -49,6 +49,8 @@ DbgBreakpoint::DbgBreakpoint()
repeat_count = hit_count = 0; repeat_count = hit_count = 0;
description[0] = 0; description[0] = 0;
source_filename = 0;
source_line = 0;
} }
DbgBreakpoint::~DbgBreakpoint() DbgBreakpoint::~DbgBreakpoint()

View file

@ -40,6 +40,7 @@ DebuggerState::DebuggerState()
next_bp_id = next_watch_id = next_display_id = 1; next_bp_id = next_watch_id = next_display_id = 1;
BreakBeforeNextStmt(false); BreakBeforeNextStmt(false);
curr_frame_idx = 0; curr_frame_idx = 0;
already_did_list = false;
BreakFromSignal(false); BreakFromSignal(false);
// ### Don't choose this arbitrary size! Extend Frame. // ### Don't choose this arbitrary size! Extend Frame.

View file

@ -64,6 +64,10 @@ Dictionary::Dictionary(dict_order ordering, int initial_size)
SetDensityThresh(DEFAULT_DENSITY_THRESH); SetDensityThresh(DEFAULT_DENSITY_THRESH);
delete_func = 0; delete_func = 0;
tbl_next_ind = 0;
num_buckets2 = num_entries2 = max_num_entries2 = thresh_entries2 = 0;
den_thresh2 = 0;
} }
Dictionary::~Dictionary() Dictionary::~Dictionary()

View file

@ -2472,6 +2472,7 @@ AssignExpr::AssignExpr(Expr* arg_op1, Expr* arg_op2, int arg_is_init,
: BinaryExpr(EXPR_ASSIGN, : BinaryExpr(EXPR_ASSIGN,
arg_is_init ? arg_op1 : arg_op1->MakeLvalue(), arg_op2) arg_is_init ? arg_op1 : arg_op1->MakeLvalue(), arg_op2)
{ {
val = 0;
is_init = arg_is_init; is_init = arg_is_init;
if ( IsError() ) if ( IsError() )
@ -3345,14 +3346,14 @@ bool HasFieldExpr::DoSerialize(SerialInfo* info) const
{ {
DO_SERIALIZE(SER_HAS_FIELD_EXPR, UnaryExpr); DO_SERIALIZE(SER_HAS_FIELD_EXPR, UnaryExpr);
// Serialize the former "bool is_attr" first for backwards compatibility. // Serialize former "bool is_attr" member first for backwards compatibility.
return SERIALIZE(false) && SERIALIZE(field_name) && SERIALIZE(field); return SERIALIZE(false) && SERIALIZE(field_name) && SERIALIZE(field);
} }
bool HasFieldExpr::DoUnserialize(UnserialInfo* info) bool HasFieldExpr::DoUnserialize(UnserialInfo* info)
{ {
DO_UNSERIALIZE(UnaryExpr); DO_UNSERIALIZE(UnaryExpr);
// Unserialize the former "bool is_attr" first for backwards compatibility. // Unserialize former "bool is_attr" member for backwards compatibility.
bool not_used; bool not_used;
return UNSERIALIZE(&not_used) && UNSERIALIZE_STR(&field_name, 0) && UNSERIALIZE(&field); return UNSERIALIZE(&not_used) && UNSERIALIZE_STR(&field_name, 0) && UNSERIALIZE(&field);
} }
@ -3361,6 +3362,8 @@ RecordConstructorExpr::RecordConstructorExpr(ListExpr* constructor_list,
BroType* arg_type) BroType* arg_type)
: UnaryExpr(EXPR_RECORD_CONSTRUCTOR, constructor_list) : UnaryExpr(EXPR_RECORD_CONSTRUCTOR, constructor_list)
{ {
ctor_type = 0;
if ( IsError() ) if ( IsError() )
return; return;
@ -3501,6 +3504,8 @@ TableConstructorExpr::TableConstructorExpr(ListExpr* constructor_list,
attr_list* arg_attrs, BroType* arg_type) attr_list* arg_attrs, BroType* arg_type)
: UnaryExpr(EXPR_TABLE_CONSTRUCTOR, constructor_list) : UnaryExpr(EXPR_TABLE_CONSTRUCTOR, constructor_list)
{ {
attrs = 0;
if ( IsError() ) if ( IsError() )
return; return;
@ -3625,6 +3630,8 @@ SetConstructorExpr::SetConstructorExpr(ListExpr* constructor_list,
attr_list* arg_attrs, BroType* arg_type) attr_list* arg_attrs, BroType* arg_type)
: UnaryExpr(EXPR_SET_CONSTRUCTOR, constructor_list) : UnaryExpr(EXPR_SET_CONSTRUCTOR, constructor_list)
{ {
attrs = 0;
if ( IsError() ) if ( IsError() )
return; return;

View file

@ -331,12 +331,10 @@ protected:
BinaryExpr() { op1 = op2 = 0; } BinaryExpr() { op1 = op2 = 0; }
BinaryExpr(BroExprTag arg_tag, Expr* arg_op1, Expr* arg_op2) BinaryExpr(BroExprTag arg_tag, Expr* arg_op1, Expr* arg_op2)
: Expr(arg_tag) : Expr(arg_tag), op1(arg_op1), op2(arg_op2)
{ {
if ( ! (arg_op1 && arg_op2) ) if ( ! (arg_op1 && arg_op2) )
return; return;
op1 = arg_op1;
op2 = arg_op2;
if ( op1->IsError() || op2->IsError() ) if ( op1->IsError() || op2->IsError() )
SetError(); SetError();
} }
@ -749,7 +747,6 @@ protected:
DECLARE_SERIAL(HasFieldExpr); DECLARE_SERIAL(HasFieldExpr);
bool is_attr;
const char* field_name; const char* field_name;
int field; int field;
}; };

View file

@ -147,7 +147,6 @@ protected:
Timer* rotate_timer; Timer* rotate_timer;
double open_time; double open_time;
bool dont_rotate; // See InstallRotateTimer()
bool print_hook; bool print_hook;
bool raw_output; bool raw_output;

View file

@ -64,7 +64,6 @@ void FlowSrc::Close()
FlowSocketSrc::~FlowSocketSrc() FlowSocketSrc::~FlowSocketSrc()
{ {
delete [] listenparms;
} }
int FlowSocketSrc::ExtractNextPDU() int FlowSocketSrc::ExtractNextPDU()

View file

@ -67,9 +67,6 @@ public:
virtual ~FlowSocketSrc(); virtual ~FlowSocketSrc();
int ExtractNextPDU(); int ExtractNextPDU();
protected:
char* listenparms;
}; };
class FlowFileSrc : public FlowSrc { class FlowFileSrc : public FlowSrc {

View file

@ -541,6 +541,10 @@ RemoteSerializer::RemoteSerializer()
in_sync = 0; in_sync = 0;
last_flush = 0; last_flush = 0;
received_logs = 0; received_logs = 0;
current_id = 0;
current_msgtype = 0;
current_args = 0;
source_peer = 0;
} }
RemoteSerializer::~RemoteSerializer() RemoteSerializer::~RemoteSerializer()

View file

@ -28,6 +28,7 @@ public:
idx = rule_counter++; idx = rule_counter++;
location = arg_location; location = arg_location;
active = true; active = true;
next = 0;
} }
~Rule(); ~Rule();

View file

@ -103,7 +103,7 @@ private:
friend class RuleMatcher; friend class RuleMatcher;
struct PatternSet { struct PatternSet {
PatternSet() {} PatternSet() : re() {}
// If we're above the 'RE_level' (see RuleMatcher), this // If we're above the 'RE_level' (see RuleMatcher), this
// expr contains all patterns on this node. If we're on // expr contains all patterns on this node. If we're on

View file

@ -20,6 +20,7 @@ public:
SerialInfo(const SerialInfo& info) SerialInfo(const SerialInfo& info)
{ {
chunk = info.chunk;
s = info.s; s = info.s;
may_suspend = info.may_suspend; may_suspend = info.may_suspend;
cache = info.cache; cache = info.cache;

View file

@ -6,8 +6,9 @@
#include "Reporter.h" #include "Reporter.h"
SerializationFormat::SerializationFormat() SerializationFormat::SerializationFormat()
: output(), output_size(), output_pos(), input(), input_len(), input_pos(),
bytes_written(), bytes_read()
{ {
output = 0;
} }
SerializationFormat::~SerializationFormat() SerializationFormat::~SerializationFormat()

View file

@ -1037,6 +1037,7 @@ void ConversionSerializer::GotPacket(Packet* p)
} }
EventPlayer::EventPlayer(const char* file) EventPlayer::EventPlayer(const char* file)
: stream_time(), replay_time(), ne_time(), ne_handler(), ne_args()
{ {
if ( ! OpenFile(file, true) || fd < 0 ) if ( ! OpenFile(file, true) || fd < 0 )
Error(fmt("event replayer: cannot open %s", file)); Error(fmt("event replayer: cannot open %s", file));

View file

@ -403,6 +403,7 @@ public:
hdr_size = 0; hdr_size = 0;
free = arg_free; free = arg_free;
tag = arg_tag; tag = arg_tag;
link_type = 0;
} }
~Packet() ~Packet()

View file

@ -55,15 +55,12 @@ struct SessionStats {
class TimerMgrExpireTimer : public Timer { class TimerMgrExpireTimer : public Timer {
public: public:
TimerMgrExpireTimer(double t, TimerMgr* arg_mgr) TimerMgrExpireTimer(double t, TimerMgr* arg_mgr)
: Timer(t, TIMER_TIMERMGR_EXPIRE) : Timer(t, TIMER_TIMERMGR_EXPIRE), mgr(arg_mgr)
{ { }
mgr = arg_mgr;
}
virtual void Dispatch(double t, int is_expire); virtual void Dispatch(double t, int is_expire);
protected: protected:
double interval;
TimerMgr* mgr; TimerMgr* mgr;
}; };

View file

@ -11,7 +11,7 @@
#include "Reporter.h" #include "Reporter.h"
BroSubstring::BroSubstring(const BroSubstring& bst) BroSubstring::BroSubstring(const BroSubstring& bst)
: BroString((const BroString&) bst), _new(bst._new) : BroString((const BroString&) bst), _num(), _new(bst._new)
{ {
for ( BSSAlignVecCIt it = bst._aligns.begin(); it != bst._aligns.end(); ++it ) for ( BSSAlignVecCIt it = bst._aligns.begin(); it != bst._aligns.end(); ++it )
_aligns.push_back(*it); _aligns.push_back(*it);

View file

@ -42,10 +42,10 @@ public:
typedef BSSAlignVec::const_iterator BSSAlignVecCIt; typedef BSSAlignVec::const_iterator BSSAlignVecCIt;
BroSubstring(const string& string) BroSubstring(const string& string)
: BroString(string), _new(false) { } : BroString(string), _num(), _new(false) { }
BroSubstring(const BroString& string) BroSubstring(const BroString& string)
: BroString(string), _new(false) { } : BroString(string), _num(), _new(false) { }
BroSubstring(const BroSubstring& bst); BroSubstring(const BroSubstring& bst);

View file

@ -399,6 +399,7 @@ PacketProfiler::PacketProfiler(unsigned int mode, double freq,
last_Utime = last_Stime = last_Rtime = 0.0; last_Utime = last_Stime = last_Rtime = 0.0;
last_timestamp = time = 0.0; last_timestamp = time = 0.0;
pkt_cnt = byte_cnt = 0; pkt_cnt = byte_cnt = 0;
last_mem = 0;
file->Write("time dt npkts nbytes dRtime dUtime dStime dmem\n"); file->Write("time dt npkts nbytes dRtime dUtime dStime dmem\n");
} }

View file

@ -29,27 +29,19 @@ public:
// The constructor takes some way of identifying the segment. // The constructor takes some way of identifying the segment.
SegmentProfiler(SegmentStatsReporter* arg_reporter, SegmentProfiler(SegmentStatsReporter* arg_reporter,
const char* arg_name) const char* arg_name)
: reporter(arg_reporter), name(arg_name), loc(), initial_rusage()
{ {
reporter = arg_reporter;
if ( reporter ) if ( reporter )
{
name = arg_name;
loc = 0;
Init(); Init();
} }
}
SegmentProfiler(SegmentStatsReporter* arg_reporter, SegmentProfiler(SegmentStatsReporter* arg_reporter,
const Location* arg_loc) const Location* arg_loc)
: reporter(arg_reporter), name(), loc(arg_loc), initial_rusage()
{ {
reporter = arg_reporter;
if ( reporter ) if ( reporter )
{
name = 0;
loc = arg_loc;
Init(); Init();
} }
}
~SegmentProfiler() ~SegmentProfiler()
{ {

View file

@ -1564,10 +1564,8 @@ bool EnumType::DoUnserialize(UnserialInfo* info)
} }
VectorType::VectorType(BroType* element_type) VectorType::VectorType(BroType* element_type)
: BroType(TYPE_VECTOR) : BroType(TYPE_VECTOR), yield_type(element_type)
{ {
if ( element_type )
yield_type = element_type;
} }
VectorType::~VectorType() VectorType::~VectorType()

View file

@ -2572,6 +2572,7 @@ unsigned int TableVal::MemoryAllocation() const
RecordVal::RecordVal(RecordType* t) : MutableVal(t) RecordVal::RecordVal(RecordType* t) : MutableVal(t)
{ {
origin = 0;
record_type = t; record_type = t;
int n = record_type->NumFields(); int n = record_type->NumFields();
val_list* vl = val.val_list_val = new val_list(n); val_list* vl = val.val_list_val = new val_list(n);

View file

@ -466,7 +466,7 @@ public:
protected: protected:
MutableVal(BroType* t) : Val(t) MutableVal(BroType* t) : Val(t)
{ props = 0; id = 0; last_modified = SerialObj::ALWAYS; } { props = 0; id = 0; last_modified = SerialObj::ALWAYS; }
MutableVal() { id = 0; last_modified = SerialObj::ALWAYS; } MutableVal() { props = 0; id = 0; last_modified = SerialObj::ALWAYS; }
~MutableVal(); ~MutableVal();
friend class ID; friend class ID;

View file

@ -20,7 +20,7 @@ public:
void Dispatch(double t, int is_expire); void Dispatch(double t, int is_expire);
protected: protected:
AnalyzerTimer() {} AnalyzerTimer() : analyzer(), timer(), do_expire() {}
void Init(Analyzer* analyzer, analyzer_timer_func timer, int do_expire); void Init(Analyzer* analyzer, analyzer_timer_func timer, int do_expire);
@ -124,6 +124,7 @@ void Analyzer::CtorInit(const Tag& arg_tag, Connection* arg_conn)
tag = arg_tag; tag = arg_tag;
id = ++id_counter; id = ++id_counter;
protocol_confirmed = false; protocol_confirmed = false;
timers_canceled = false;
skip = false; skip = false;
finished = false; finished = false;
removing = false; removing = false;

View file

@ -11,7 +11,8 @@
using namespace analyzer::conn_size; using namespace analyzer::conn_size;
ConnSize_Analyzer::ConnSize_Analyzer(Connection* c) ConnSize_Analyzer::ConnSize_Analyzer(Connection* c)
: Analyzer("CONNSIZE", c) : Analyzer("CONNSIZE", c),
orig_bytes(), resp_bytes(), orig_pkts(), resp_pkts()
{ {
} }

View file

@ -894,6 +894,7 @@ DNS_MsgInfo::DNS_MsgInfo(DNS_RawMsgHdr* hdr, int arg_is_query)
answer_type = DNS_QUESTION; answer_type = DNS_QUESTION;
skip_event = 0; skip_event = 0;
tsig = 0;
} }
DNS_MsgInfo::~DNS_MsgInfo() DNS_MsgInfo::~DNS_MsgInfo()
@ -1002,7 +1003,7 @@ Contents_DNS::Contents_DNS(Connection* conn, bool orig,
interp = arg_interp; interp = arg_interp;
msg_buf = 0; msg_buf = 0;
buf_n = msg_size = 0; buf_n = buf_len = msg_size = 0;
state = DNS_LEN_HI; state = DNS_LEN_HI;
} }

View file

@ -144,7 +144,6 @@ public:
// More values for spesific DNS types. // More values for spesific DNS types.
// struct EDNS_ADDITIONAL* edns; // struct EDNS_ADDITIONAL* edns;
int tsig_init;
struct TSIG_DATA* tsig; struct TSIG_DATA* tsig;
}; };

View file

@ -534,6 +534,7 @@ HTTP_Message::HTTP_Message(HTTP_Analyzer* arg_analyzer,
top_level = new HTTP_Entity(this, 0, expect_body); top_level = new HTTP_Entity(this, 0, expect_body);
BeginEntity(top_level); BeginEntity(top_level);
buffer_offset = buffer_size = 0;
data_buffer = 0; data_buffer = 0;
total_buffer_size = 0; total_buffer_size = 0;

View file

@ -17,11 +17,10 @@
using namespace analyzer::icmp; using namespace analyzer::icmp;
ICMP_Analyzer::ICMP_Analyzer(Connection* c) ICMP_Analyzer::ICMP_Analyzer(Connection* c)
: TransportLayerAnalyzer("ICMP", c) : TransportLayerAnalyzer("ICMP", c),
icmp_conn_val(), type(), code(), request_len(-1), reply_len(-1)
{ {
icmp_conn_val = 0;
c->SetInactivityTimeout(icmp_inactivity_timeout); c->SetInactivityTimeout(icmp_inactivity_timeout);
request_len = reply_len = -1;
} }
void ICMP_Analyzer::Done() void ICMP_Analyzer::Done()

View file

@ -25,7 +25,7 @@ static RE_Matcher* re_login_timeouts;
static RE_Matcher* init_RE(ListVal* l); static RE_Matcher* init_RE(ListVal* l);
Login_Analyzer::Login_Analyzer(const char* name, Connection* conn) Login_Analyzer::Login_Analyzer(const char* name, Connection* conn)
: tcp::TCP_ApplicationAnalyzer(name, conn) : tcp::TCP_ApplicationAnalyzer(name, conn), user_text()
{ {
state = LOGIN_STATE_AUTHENTICATE; state = LOGIN_STATE_AUTHENTICATE;
num_user_lines_seen = lines_scanned = 0; num_user_lines_seen = lines_scanned = 0;

View file

@ -364,14 +364,11 @@ void TelnetBinaryOption::InconsistentOption(unsigned int /* type */)
NVT_Analyzer::NVT_Analyzer(Connection* conn, bool orig) NVT_Analyzer::NVT_Analyzer(Connection* conn, bool orig)
: tcp::ContentLine_Analyzer("NVT", conn, orig) : tcp::ContentLine_Analyzer("NVT", conn, orig),
peer(), pending_IAC(), IAC_pos(), is_suboption(), last_was_IAC(),
binary_mode(), encrypting_mode(), authentication_has_been_accepted(),
auth_name(), options(), num_options()
{ {
peer = 0;
is_suboption = last_was_IAC = pending_IAC = 0;
IAC_pos = 0;
num_options = 0;
authentication_has_been_accepted = encrypting_mode = binary_mode = 0;
auth_name = 0;
} }
NVT_Analyzer::~NVT_Analyzer() NVT_Analyzer::~NVT_Analyzer()

View file

@ -22,7 +22,10 @@ Contents_Rsh_Analyzer::Contents_Rsh_Analyzer(Connection* conn, bool orig,
if ( orig ) if ( orig )
state = save_state = RSH_FIRST_NULL; state = save_state = RSH_FIRST_NULL;
else else
{
state = RSH_LINE_MODE; state = RSH_LINE_MODE;
save_state = RSH_UNKNOWN;
}
} }
Contents_Rsh_Analyzer::~Contents_Rsh_Analyzer() Contents_Rsh_Analyzer::~Contents_Rsh_Analyzer()

View file

@ -1257,7 +1257,7 @@ TableVal* MIME_Message::BuildHeaderTable(MIME_HeaderList& hlist)
} }
MIME_Mail::MIME_Mail(analyzer::Analyzer* mail_analyzer, int buf_size) MIME_Mail::MIME_Mail(analyzer::Analyzer* mail_analyzer, int buf_size)
: MIME_Message(mail_analyzer) : MIME_Message(mail_analyzer), md5_hash()
{ {
analyzer = mail_analyzer; analyzer = mail_analyzer;
@ -1280,12 +1280,13 @@ MIME_Mail::MIME_Mail(analyzer::Analyzer* mail_analyzer, int buf_size)
if ( mime_content_hash ) if ( mime_content_hash )
{ {
compute_content_hash = 1; compute_content_hash = 1;
content_hash_length = 0;
md5_init(&md5_hash); md5_init(&md5_hash);
} }
else else
compute_content_hash = 0; compute_content_hash = 0;
content_hash_length = 0;
top_level = new MIME_Entity(this, 0); // to be changed to MIME_Mail top_level = new MIME_Entity(this, 0); // to be changed to MIME_Mail
BeginEntity(top_level); BeginEntity(top_level);
} }

View file

@ -247,7 +247,6 @@ protected:
int max_chunk_length; int max_chunk_length;
int buffer_start; int buffer_start;
int data_start; int data_start;
int buffer_offset;
int compute_content_hash; int compute_content_hash;
int content_hash_length; int content_hash_length;
MD5_CTX md5_hash; MD5_CTX md5_hash;

View file

@ -346,7 +346,7 @@ Contents_NetbiosSSN::Contents_NetbiosSSN(Connection* conn, bool orig,
interp = arg_interp; interp = arg_interp;
type = flags = msg_size = 0; type = flags = msg_size = 0;
msg_buf = 0; msg_buf = 0;
buf_n = msg_size = 0; buf_n = buf_len = msg_size = 0;
state = NETBIOS_SSN_TYPE; state = NETBIOS_SSN_TYPE;
} }

View file

@ -7,9 +7,8 @@
using namespace analyzer::pia; using namespace analyzer::pia;
PIA::PIA(analyzer::Analyzer* arg_as_analyzer) PIA::PIA(analyzer::Analyzer* arg_as_analyzer)
: state(INIT), as_analyzer(arg_as_analyzer), conn(), current_packet()
{ {
current_packet.data = 0;
as_analyzer = arg_as_analyzer;
} }
PIA::~PIA() PIA::~PIA()

View file

@ -43,6 +43,9 @@ POP3_Analyzer::POP3_Analyzer(Connection* conn)
multiLine = false; multiLine = false;
backOff = false; backOff = false;
lastRequiredCommand = 0;
authLines = 0;
mail = 0; mail = 0;
AddSupportAnalyzer(new tcp::ContentLine_Analyzer(conn, true)); AddSupportAnalyzer(new tcp::ContentLine_Analyzer(conn, true));

View file

@ -679,10 +679,9 @@ void Contents_RPC::DeliverStream(int len, const u_char* data, bool orig)
RPC_Analyzer::RPC_Analyzer(const char* name, Connection* conn, RPC_Analyzer::RPC_Analyzer(const char* name, Connection* conn,
RPC_Interpreter* arg_interp) RPC_Interpreter* arg_interp)
: tcp::TCP_ApplicationAnalyzer(name, conn) : tcp::TCP_ApplicationAnalyzer(name, conn),
interp(arg_interp), orig_rpc(), resp_rpc()
{ {
interp = arg_interp;
if ( Conn()->ConnTransport() == TRANSPORT_UDP ) if ( Conn()->ConnTransport() == TRANSPORT_UDP )
ADD_ANALYZER_TIMER(&RPC_Analyzer::ExpireTimer, ADD_ANALYZER_TIMER(&RPC_Analyzer::ExpireTimer,
network_time + rpc_timeout, 1, TIMER_RPC_EXPIRE); network_time + rpc_timeout, 1, TIMER_RPC_EXPIRE);

View file

@ -100,6 +100,9 @@ static int lookup_IPC_name(BroString* name)
SMB_Session::SMB_Session(analyzer::Analyzer* arg_analyzer) SMB_Session::SMB_Session(analyzer::Analyzer* arg_analyzer)
{ {
analyzer = arg_analyzer; analyzer = arg_analyzer;
req_cmd = 0;
smb_mailslot_prot = false;
smb_pipe_prot = false;
dce_rpc_session = 0; dce_rpc_session = 0;
init_SMB_command_name(); init_SMB_command_name();

View file

@ -2043,7 +2043,8 @@ RecordVal* TCPStats_Endpoint::BuildStats()
} }
TCPStats_Analyzer::TCPStats_Analyzer(Connection* c) TCPStats_Analyzer::TCPStats_Analyzer(Connection* c)
: TCP_ApplicationAnalyzer("TCPSTATS", c) : TCP_ApplicationAnalyzer("TCPSTATS", c),
orig_stats(), resp_stats()
{ {
} }

View file

@ -25,12 +25,15 @@ TCP_Endpoint::TCP_Endpoint(TCP_Analyzer* arg_analyzer, int arg_is_orig)
window_scale = 0; window_scale = 0;
window_seq = window_ack_seq = 0; window_seq = window_ack_seq = 0;
contents_start_seq = 0; contents_start_seq = 0;
FIN_seq = 0;
SYN_cnt = FIN_cnt = RST_cnt = 0; SYN_cnt = FIN_cnt = RST_cnt = 0;
did_close = 0; did_close = 0;
contents_file = 0; contents_file = 0;
tcp_analyzer = arg_analyzer; tcp_analyzer = arg_analyzer;
is_orig = arg_is_orig; is_orig = arg_is_orig;
hist_last_SYN = hist_last_FIN = hist_last_RST = 0;
src_addr = is_orig ? tcp_analyzer->Conn()->RespAddr() : src_addr = is_orig ? tcp_analyzer->Conn()->RespAddr() :
tcp_analyzer->Conn()->OrigAddr(); tcp_analyzer->Conn()->OrigAddr();
dst_addr = is_orig ? tcp_analyzer->Conn()->OrigAddr() : dst_addr = is_orig ? tcp_analyzer->Conn()->OrigAddr() :

View file

@ -28,6 +28,7 @@ BuiltinFuncArg::BuiltinFuncArg(const char* arg_name, int arg_type)
name = arg_name; name = arg_name;
type = arg_type; type = arg_type;
type_str = ""; type_str = "";
attr_str = "";
} }
BuiltinFuncArg::BuiltinFuncArg(const char* arg_name, const char* arg_type_str, BuiltinFuncArg::BuiltinFuncArg(const char* arg_name, const char* arg_type_str,

View file

@ -30,7 +30,6 @@ private:
binpac::Unified2::Unified2_Analyzer* interp; binpac::Unified2::Unified2_Analyzer* interp;
string filename; string filename;
int fd;
}; };
} // namespace file_analysis } // namespace file_analysis

View file

@ -84,16 +84,16 @@ public:
RecordVal* description; RecordVal* description;
Stream();
virtual ~Stream(); virtual ~Stream();
protected:
Stream(StreamType t);
}; };
Manager::Stream::Stream() Manager::Stream::Stream(StreamType t)
: name(), removed(), stream_type(t), type(), reader(), config(),
description()
{ {
type = 0;
reader = 0;
description = 0;
removed = false;
} }
Manager::Stream::~Stream() Manager::Stream::~Stream()
@ -154,24 +154,17 @@ public:
~AnalysisStream(); ~AnalysisStream();
}; };
Manager::TableStream::TableStream() : Manager::Stream::Stream() Manager::TableStream::TableStream()
: Manager::Stream::Stream(TABLE_STREAM),
num_idx_fields(), num_val_fields(), want_record(), tab(), rtype(),
itype(), currDict(), lastDict(), pred(), event()
{ {
stream_type = TABLE_STREAM;
tab = 0;
itype = 0;
rtype = 0;
currDict = 0;
lastDict = 0;
pred = 0;
} }
Manager::EventStream::EventStream() : Manager::Stream::Stream() Manager::EventStream::EventStream()
: Manager::Stream::Stream(EVENT_STREAM),
event(), fields(), num_fields(), want_record()
{ {
fields = 0;
stream_type = EVENT_STREAM;
} }
Manager::EventStream::~EventStream() Manager::EventStream::~EventStream()
@ -204,9 +197,9 @@ Manager::TableStream::~TableStream()
} }
} }
Manager::AnalysisStream::AnalysisStream() : Manager::Stream::Stream() Manager::AnalysisStream::AnalysisStream()
: Manager::Stream::Stream(ANALYSIS_STREAM), file_id()
{ {
stream_type = ANALYSIS_STREAM;
} }
Manager::AnalysisStream::~AnalysisStream() Manager::AnalysisStream::~AnalysisStream()

View file

@ -163,6 +163,8 @@ ReaderBackend::ReaderBackend(ReaderFrontend* arg_frontend) : MsgThread()
disabled = true; // disabled will be set correcty in init. disabled = true; // disabled will be set correcty in init.
frontend = arg_frontend; frontend = arg_frontend;
info = new ReaderInfo(frontend->Info()); info = new ReaderInfo(frontend->Info());
num_fields = 0;
fields = 0;
SetName(frontend->Name()); SetName(frontend->Name());
} }

View file

@ -18,7 +18,7 @@ using threading::Value;
using threading::Field; using threading::Field;
FieldMapping::FieldMapping(const string& arg_name, const TypeTag& arg_type, int arg_position) FieldMapping::FieldMapping(const string& arg_name, const TypeTag& arg_type, int arg_position)
: name(arg_name), type(arg_type) : name(arg_name), type(arg_type), subtype(TYPE_ERROR)
{ {
position = arg_position; position = arg_position;
secondary_position = -1; secondary_position = -1;
@ -49,6 +49,7 @@ FieldMapping FieldMapping::subType()
Ascii::Ascii(ReaderFrontend *frontend) : ReaderBackend(frontend) Ascii::Ascii(ReaderFrontend *frontend) : ReaderBackend(frontend)
{ {
file = 0; file = 0;
mtime = 0;
separator.assign( (const char*) BifConst::InputAscii::separator->Bytes(), separator.assign( (const char*) BifConst::InputAscii::separator->Bytes(),
BifConst::InputAscii::separator->Len()); BifConst::InputAscii::separator->Len());

View file

@ -18,6 +18,7 @@ using threading::Field;
Benchmark::Benchmark(ReaderFrontend *frontend) : ReaderBackend(frontend) Benchmark::Benchmark(ReaderFrontend *frontend) : ReaderBackend(frontend)
{ {
num_lines = 0;
multiplication_factor = double(BifConst::InputBenchmark::factor); multiplication_factor = double(BifConst::InputBenchmark::factor);
autospread = double(BifConst::InputBenchmark::autospread); autospread = double(BifConst::InputBenchmark::autospread);
spread = int(BifConst::InputBenchmark::spread); spread = int(BifConst::InputBenchmark::spread);
@ -25,6 +26,7 @@ Benchmark::Benchmark(ReaderFrontend *frontend) : ReaderBackend(frontend)
autospread_time = 0; autospread_time = 0;
stopspreadat = int(BifConst::InputBenchmark::stopspreadat); stopspreadat = int(BifConst::InputBenchmark::stopspreadat);
timedspread = double(BifConst::InputBenchmark::timedspread); timedspread = double(BifConst::InputBenchmark::timedspread);
heartbeatstarttime = 0;
heartbeat_interval = double(BifConst::Threading::heartbeat_interval); heartbeat_interval = double(BifConst::Threading::heartbeat_interval);
ascii = new AsciiFormatter(this, AsciiFormatter::SeparatorInfo()); ascii = new AsciiFormatter(this, AsciiFormatter::SeparatorInfo());

View file

@ -34,6 +34,9 @@ Raw::Raw(ReaderFrontend *frontend) : ReaderBackend(frontend)
{ {
file = 0; file = 0;
stderrfile = 0; stderrfile = 0;
execute = false;
firstrun = true;
mtime = 0;
forcekill = false; forcekill = false;
separator.assign( (const char*) BifConst::InputRaw::record_separator->Bytes(), separator.assign( (const char*) BifConst::InputRaw::record_separator->Bytes(),
BifConst::InputRaw::record_separator->Len()); BifConst::InputRaw::record_separator->Len());

View file

@ -17,7 +17,9 @@ using namespace input::reader;
using threading::Value; using threading::Value;
using threading::Field; using threading::Field;
SQLite::SQLite(ReaderFrontend *frontend) : ReaderBackend(frontend) SQLite::SQLite(ReaderFrontend *frontend)
: ReaderBackend(frontend),
fields(), num_fields(), mode(), started(), query(), db(), st()
{ {
set_separator.assign( set_separator.assign(
(const char*) BifConst::LogSQLite::set_separator->Bytes(), (const char*) BifConst::LogSQLite::set_separator->Bytes(),

View file

@ -112,6 +112,9 @@ WriterFrontend::WriterFrontend(const WriterBackend::WriterInfo& arg_info, EnumVa
write_buffer_pos = 0; write_buffer_pos = 0;
info = new WriterBackend::WriterInfo(arg_info); info = new WriterBackend::WriterInfo(arg_info);
num_fields = 0;
fields = 0;
const char* w = arg_writer->Type()->AsEnumType()->Lookup(arg_writer->InternalInt()); const char* w = arg_writer->Type()->AsEnumType()->Lookup(arg_writer->InternalInt());
name = copy_string(fmt("%s/%s", arg_info.path, w)); name = copy_string(fmt("%s/%s", arg_info.path, w));

View file

@ -233,6 +233,10 @@ DataSeries::DataSeries(WriterFrontend* frontend) : WriterBackend(frontend)
ds_set_separator = ","; ds_set_separator = ",";
ascii = new AsciiFormatter(this, AsciiFormatter::SeparatorInfo()); ascii = new AsciiFormatter(this, AsciiFormatter::SeparatorInfo());
compress_type = Extent::compress_none;
log_file = 0;
log_output = 0;
} }
DataSeries::~DataSeries() DataSeries::~DataSeries()

View file

@ -16,7 +16,9 @@ using namespace writer;
using threading::Value; using threading::Value;
using threading::Field; using threading::Field;
SQLite::SQLite(WriterFrontend* frontend) : WriterBackend(frontend) SQLite::SQLite(WriterFrontend* frontend)
: WriterBackend(frontend),
fields(), num_fields(), db(), st()
{ {
set_separator.assign( set_separator.assign(
(const char*) BifConst::LogSQLite::set_separator->Bytes(), (const char*) BifConst::LogSQLite::set_separator->Bytes(),
@ -33,9 +35,7 @@ SQLite::SQLite(WriterFrontend* frontend) : WriterBackend(frontend)
BifConst::LogSQLite::empty_field->Len() BifConst::LogSQLite::empty_field->Len()
); );
db = 0;
io = new AsciiFormatter(this, AsciiFormatter::SeparatorInfo(set_separator, unset_field, empty_field)); io = new AsciiFormatter(this, AsciiFormatter::SeparatorInfo(set_separator, unset_field, empty_field));
st = 0;
} }
SQLite::~SQLite() SQLite::~SQLite()

View file

@ -81,7 +81,7 @@ private:
friend class ::RemoteSerializer; friend class ::RemoteSerializer;
// Force usage of constructor above. // Force usage of constructor above.
Field() {}; Field() {}
}; };
/** /**