libtt: Coverity fixes related to uninitialised fields in classes.

This commit is contained in:
Peter Howkins
2018-04-18 01:28:03 +01:00
parent caef8edac0
commit 02d43dabe6
30 changed files with 90 additions and 14 deletions

View File

@@ -48,6 +48,9 @@ _Tt_observer()
_ptid = (char *)0;
_reliability = TT_DISCARD;
_opnum = -1;
_scope = NULL;
_state = TT_STATE_LAST; // BUG This class member is not set anywhere, but a getter function exists
}
@@ -59,7 +62,7 @@ _Tt_observer(_Tt_string ptid, int opnum,
_reliability = reliability;
_opnum = opnum;
_scope = s;
_state = TT_STATE_LAST; // BUG This class member is not set anywhere, but a getter function exists
}

View File

@@ -43,7 +43,7 @@
class _Tt_rpc_server : public _Tt_object {
public:
_Tt_rpc_server() {};
_Tt_rpc_server() { _version = 0; _socket = 0; _program = 0; _rpc_fd = 0; _transp = NULL; };
_Tt_rpc_server(int program, int version, int Rsocket, _Tt_auth &auth);
virtual ~_Tt_rpc_server();
int init(void (*service_fn)(svc_req *, SVCXPRT *));

View File

@@ -160,6 +160,7 @@ _Tt_s_message(_Tt_s_message *m, _Tt_observer_ptr &o)
_rsessions = m->_rsessions;
_when_last_matched = m->_when_last_matched;
_original = m;
_num_recipients_yet_to_vote = 0;
}
//

View File

@@ -94,6 +94,11 @@ _Tt_s_mp() : _Tt_mp()
when_last_observer_registered = 1;
update_args.message = new _Tt_s_message();
_self = (_Tt_s_procid *)new _Tt_self_procid();
map_ptypes = 0;
unix_cred_chk_flag = 0;
garbage_collector_pid = 0;
_next_garbage_run = 0;
}

View File

@@ -66,7 +66,7 @@ _Tt_s_procid(const _Tt_s_procid_ptr &p)
_proc_host_ipaddr = p->_proc_host_ipaddr;
_pid = p->_pid;
_id = p->_id;
_itimeout = -1;
}
_Tt_s_procid::