libtt: More coverity fixes

This commit is contained in:
Peter Howkins
2018-04-13 19:08:50 +01:00
parent 17101b6f4c
commit fee6003be1
19 changed files with 56 additions and 8 deletions

View File

@@ -55,6 +55,7 @@ _Tt_api_handle_table::
_Tt_api_handle_table()
{
content = new _Tt_api_handle_list;
last_phandle = NULL;
}
/*
@@ -615,6 +616,7 @@ print(FILE *f) const
_Tt_api_callback::
_Tt_api_callback()
{
callback = NULL;
}
_Tt_api_callback::
@@ -631,6 +633,8 @@ _Tt_api_handle_table::
_Tt_api_userdata::
_Tt_api_userdata()
{
key = 0;
userdata = NULL;
}
_Tt_api_userdata::

View File

@@ -43,7 +43,12 @@
class _Tt_client_isam_record : public _Tt_object {
public:
// Dummy constructor needed to make tt_client_isam_record_utils.cc happy
_Tt_client_isam_record () {}
_Tt_client_isam_record ()
{
currentLength = 0;
maxLength = 0;
minLength = 0;
}
// Real constructor
_Tt_client_isam_record (const _Tt_client_isam_key_descriptor_list_ptr &key_descriptor_list,

View File

@@ -93,6 +93,14 @@ _Tt_db_client::_Tt_db_client (_Tt_db_results & status)
setTtDBDefaults();
connectToDB(db_hostname);
status = dbConnectionResults;
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 (const _Tt_string &hostname, _Tt_db_results & status)

View File

@@ -45,6 +45,12 @@
_Tt_db_file::
_Tt_db_file()
{
dbResults = TT_DB_ERR_ILLEGAL_FILE;
checkedDatabase = FALSE;
directoryFlag = FALSE;
dbFileObjectsCacheLevel = -1;
dbFilePropertiesCacheLevel = -1;
dbResults = TT_DB_OK;
}
_Tt_db_file::_Tt_db_file (const _Tt_string &file)

View File

@@ -46,6 +46,10 @@ _Tt_auth(_Tt_auth_level auth_level)
{
_auth_level = auth_level;
_auth_cookie = "";
_rpc_program = 0;
_rpc_version = 0;
_entries_head = NULL;
_entries_tail = NULL;
}

View File

@@ -82,6 +82,7 @@ _Tt_desktop()
{
priv = (_Tt_desktop_private *)malloc(sizeof(_Tt_desktop_private));
priv->xd = (Display *)0;
user_io_handler = NULL;
}

View File

@@ -58,6 +58,7 @@ _Tt_procid()
_version = 0;
_flags = 0;
_mxdr_stream = (XDR *)0;
_program = 0;
}

View File

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

View File

@@ -53,7 +53,8 @@ _Tt_object_table(int n)
num_buckets = n;
buckets = (_Tt_object_list_ptr *)calloc(n,
sizeof(_Tt_object_list_ptr));
_count = 0;
_count = 0;
_getkey = NULL;
}
_Tt_object_table::

View File

@@ -51,6 +51,8 @@ _Tt_trace_parser::_Tt_trace_parser()
: trace_stream()
{
tracer_init();
mode = 0; // Technically this is openmode O_RDONLY but will be overwritten
}
_Tt_trace_parser::_Tt_trace_parser(_Tt_trace_parser& templ)
@@ -94,12 +96,16 @@ _Tt_trace_parser::_Tt_trace_parser(int fd)
trace_stream[trace_stream.len()] = '\0';
tracer_init();
mode = 0; // Technically this is openmode O_RDONLY but will be overwritten
}
_Tt_trace_parser::_Tt_trace_parser(const char* script)
{
trace_stream = script;
tracer_init();
mode = 0; // Technically this is openmode O_RDONLY but will be overwritten
}
void

View File

@@ -44,6 +44,7 @@ const int Tt_trace_buf_len = 4096;
_Tt_trace_stream::_Tt_trace_stream()
{
_is_entered = 0;
}
_Tt_trace_stream::_Tt_trace_stream(

View File

@@ -31,6 +31,7 @@
*
* Copyright (c) 1990 by Sun Microsystems, Inc.
*/
#include <stdint.h>
#if defined(ultrix)
#include <rpc/types.h>
#define bool_t int
@@ -101,7 +102,7 @@ tt_x_inline(XDR *xp, int len)
/* It is better to promote len to caddr_t than demote x_base to
int for 64 bit arch.
*/
if (len > 0 && (caddr_t) len < xp->x_base) {
if (len > 0 && (caddr_t) (intptr_t) len < xp->x_base) {
xp->x_handy += RNDUP (len);
#if defined(ultrix) || defined(__osf__)
return (int *) xp->x_private;