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

@@ -45,7 +45,7 @@ declare_ptr_to(_Tt_api_stg_stack)
class _Tt_api_stg_stack_elm : public _Tt_object {
public:
_Tt_api_stg_stack_elm() {};
_Tt_api_stg_stack_elm() { addr = NULL; };
~_Tt_api_stg_stack_elm();
enum {STACK_MARK, STACK_STORAGE} entry_type;
caddr_t addr;

View File

@@ -44,6 +44,7 @@ _Tt_typecb::
_Tt_typecb()
{
clientdata = 0;
_opnum = 0;
}
_Tt_typecb::

View File

@@ -89,6 +89,8 @@ _Tt_client_isam_file
currentRecordLength = -1;
currentRecordNumber = -1;
}
maxRecordLength = 0;
minRecordLength = 0;
}
void _Tt_client_isam_file::setTtISAMFileDefaults ()

View File

@@ -44,7 +44,8 @@
class _Tt_client_isam_file : public _Tt_object {
public:
// Dummy constructor needed to make _tt_client_isam_file_utils.cc happy
_Tt_client_isam_file () {}
_Tt_client_isam_file () { currentRecordLength = 0; currentRecordNumber = 0; eraseFlag = 0; errorStatus = 0;
fileDescriptor = 0; fileMode = 0; maxRecordLength = 0; minRecordLength = 0; newFlag = 0; }
// Real constructors
_Tt_client_isam_file (const _Tt_string &file,

View File

@@ -84,6 +84,13 @@ _Tt_db_client::_Tt_db_client()
setTtDBDefaults();
connectToDB(db_hostname);
iserrno = 0;
isrecnum = 0;
isreclen = 0;
#if !defined(OPT_TLI)
dbSocket.sin_family = 0;
dbSocket.sin_port = 0;
#endif
}
_Tt_db_client::_Tt_db_client (_Tt_db_results & status)

View File

@@ -63,6 +63,11 @@ _Tt_db_file::_Tt_db_file (const _Tt_string &file)
_Tt_db_access_ptr access;
dbResults = setTtDBFileDefaults(file, properties, access);
}
checkedDatabase = FALSE;
directoryFlag = FALSE;
dbFileObjectsCacheLevel = -1;
dbFilePropertiesCacheLevel = -1;
}
_Tt_db_file::_Tt_db_file (const _Tt_string &file,
@@ -75,6 +80,11 @@ _Tt_db_file::_Tt_db_file (const _Tt_string &file,
else {
dbResults = setTtDBFileDefaults(file, properties, access);
}
checkedDatabase = 0;
directoryFlag = 0;
dbFileObjectsCacheLevel = -1;
dbFilePropertiesCacheLevel = -1;
}
_Tt_db_results

View File

@@ -50,7 +50,9 @@
_Tt_old_db::
_Tt_old_db()
{
}
propertyTableFD = 0;
dbResults = NULL;
}
_Tt_old_db::_Tt_old_db (const _Tt_string &partition,
const _Tt_db_client_ptr &db_conn)

View File

@@ -37,6 +37,9 @@
_Tt_old_db_message_info::
_Tt_old_db_message_info ()
{
messageID = 0;
numParts = 0;
messageSize = 0;
}
_Tt_old_db_message_info::

View File

@@ -49,6 +49,11 @@ _Tt_qmsg_info::_Tt_qmsg_info()
categories = new _Tt_int_rec_list;
ptypes = new _Tt_string_list;
version = TT_QMSG_INFO_VERSION;
id = 0;
nparts = 0;
size = 0;
m_id = 0;
}
_Tt_qmsg_info::~_Tt_qmsg_info()

View File

@@ -88,6 +88,12 @@ _Tt_rpc_client(int conn_socket)
{
_socket = conn_socket;
_client = (CLIENT *)0;
_program = 0;
_version = 0;
_server_uid = 0;
_clnt_stat = NULL;
_server_addr.sin_family = 0;
_server_addr.sin_port = 0;
}

View File

@@ -66,6 +66,10 @@ _Tt_session()
_is_server = 0; // default server mode
_is_dead = 0;
_rpc_version = 0;
_pid = 0;
_rpc_program = 0;
_server_num = 0;
_server_uid = 0;
}

View File

@@ -83,6 +83,11 @@ char *t_strerror(int t_errno)
_Tt_stream_socket::
_Tt_stream_socket()
{
_is_source = 0;
_msgsock = -1;
_sock = -1;
_hostaddr.sin_port = 0;
_hostaddr.sin_family = 0;
}
_Tt_stream_socket::
@@ -94,6 +99,8 @@ _Tt_stream_socket(_Tt_host_ptr &host, int portnum)
_hostaddr.sin_addr.s_addr = htonl(INADDR_ANY);
_hostaddr.sin_port = htons(portnum);
_hostaddr.sin_family = AF_INET;
_is_source = 0;
_sock = -1;
}

View File

@@ -42,6 +42,8 @@ implement_list_of(_Tt_file_system_entry)
_Tt_file_system_entry::
_Tt_file_system_entry ()
{
localFlag = 0;
loopBackFlag = 0;
}
_Tt_file_system_entry::

View File

@@ -53,6 +53,7 @@ _Tt_hostname_cache::
_Tt_hostname_cache()
{
hostname = (_Tt_string) 0;
addr_length = 0;
}
_Tt_hostname_cache::

View File

@@ -76,6 +76,7 @@ implement_list_of(_Tt_int_rec)
_Tt_pid_t_rec::
_Tt_pid_t_rec()
{
val = 0;
}