From b807066429210216fd90ee97ec7bafef128e52be Mon Sep 17 00:00:00 2001 From: Peter Howkins Date: Sun, 19 Dec 2021 04:06:45 +0000 Subject: [PATCH] libdtsvc: Resolve Uninitialized warnings --- cde/lib/DtSvc/DtEncap/spc-proto.c | 4 ++-- cde/lib/DtSvc/DtEncap/spc-xt.c | 5 ++--- cde/lib/DtSvc/DtUtil1/ActionDb.c | 2 +- cde/lib/DtSvc/DtUtil1/ActionTt.c | 4 ++-- cde/lib/DtSvc/DtUtil1/DbReader.c | 2 +- cde/lib/DtSvc/DtUtil1/Dts.c | 2 +- cde/lib/DtSvc/DtUtil1/SmComm.c | 2 +- cde/lib/DtSvc/DtUtil2/ChkpntListen.c | 2 +- cde/lib/DtSvc/DtUtil2/Hash.c | 4 ++-- cde/lib/DtSvc/DtUtil2/SharedProcs.c | 2 +- cde/lib/DtSvc/DtUtil2/addToRes.c | 2 +- 11 files changed, 15 insertions(+), 16 deletions(-) diff --git a/cde/lib/DtSvc/DtEncap/spc-proto.c b/cde/lib/DtSvc/DtEncap/spc-proto.c index 1d929b8ed..6795335f1 100644 --- a/cde/lib/DtSvc/DtEncap/spc-proto.c +++ b/cde/lib/DtSvc/DtEncap/spc-proto.c @@ -1658,7 +1658,7 @@ int SPC_Query_Logfile(SPC_Channel_Ptr channel) { SPC_Connection_Ptr connection=channel->connection; protocol_request_ptr prot; - XeString junk1, junk2; + XeString junk1 = NULL, junk2 = NULL; SPC_Write_Protocol_Request(connection, channel, QUERY_LOGFILE); prot=SPC_Filter_Connection(connection, channel, LOGFILE_REPLY, TRUE); @@ -1713,7 +1713,7 @@ SPC_Validate_User(XeString hostname, { XeString username = XeString_NULL; uid_t this_uid; - XeString proto_ver; + XeString proto_ver = NULL; XeString hostinfo; XeString path; protocol_request_ptr prot; diff --git a/cde/lib/DtSvc/DtEncap/spc-xt.c b/cde/lib/DtSvc/DtEncap/spc-xt.c index d1a935e64..b81e63bae 100644 --- a/cde/lib/DtSvc/DtEncap/spc-xt.c +++ b/cde/lib/DtSvc/DtEncap/spc-xt.c @@ -203,7 +203,7 @@ void SPC_XtAddInput(SPC_Channel_Ptr channel, SPC_Callback_Condition condition) /*-----------------------------------------------------------------------+*/ { - SbInputId id; + SbInputId id = 0; switch(condition) { @@ -224,8 +224,7 @@ void SPC_XtAddInput(SPC_Channel_Ptr channel, else id = (*SbAddException_hookfn)(fd, handler, channel); break; - - } + } *id_addr=SPC_AddInput(fd, condition, id); } diff --git a/cde/lib/DtSvc/DtUtil1/ActionDb.c b/cde/lib/DtSvc/DtUtil1/ActionDb.c index 9716d21a1..a31ecdae0 100644 --- a/cde/lib/DtSvc/DtUtil1/ActionDb.c +++ b/cde/lib/DtSvc/DtUtil1/ActionDb.c @@ -1003,7 +1003,7 @@ _DtActionConverter(DtDtsDbField * fields, char bigBuf[_DtAct_MAX_BUF_SIZE]; char *buf = bigBuf; char *fileName = _DtDbPathIdToString(pathId); - char *actionType; + char *actionType = NULL; _DtSvcProcessLock(); if (firstTime) diff --git a/cde/lib/DtSvc/DtUtil1/ActionTt.c b/cde/lib/DtSvc/DtUtil1/ActionTt.c index 02de21968..ee556fb18 100644 --- a/cde/lib/DtSvc/DtUtil1/ActionTt.c +++ b/cde/lib/DtSvc/DtUtil1/ActionTt.c @@ -885,7 +885,7 @@ TtRequestCallbackHandler( int argRepType; char *upttbuf; int upttbuflen, ivalue; - char *upVType, *upVType2; + char *upVType = NULL, *upVType2 = NULL; status = (Tt_status) tt_message_status(message); @@ -1174,7 +1174,7 @@ InitiateTtRequest( ActionRequest *request ) { - CallbackData *data; + CallbackData *data = NULL; ActionPtr action = request->clonedAction; tt_msgAttr * tt = &(action->u.tt_msg); int i; diff --git a/cde/lib/DtSvc/DtUtil1/DbReader.c b/cde/lib/DtSvc/DtUtil1/DbReader.c index 93ab9b7e1..3e1661d35 100644 --- a/cde/lib/DtSvc/DtUtil1/DbReader.c +++ b/cde/lib/DtSvc/DtUtil1/DbReader.c @@ -961,7 +961,7 @@ ReadNextEntry( char *start; char *last; char *save; - char *error_buffer; + char *error_buffer = NULL; short startDef; char * errorName; char * version; diff --git a/cde/lib/DtSvc/DtUtil1/Dts.c b/cde/lib/DtSvc/DtUtil1/Dts.c index c5160af30..0e29ba405 100644 --- a/cde/lib/DtSvc/DtUtil1/Dts.c +++ b/cde/lib/DtSvc/DtUtil1/Dts.c @@ -1951,7 +1951,7 @@ DtDtsSetDataType(const char *filename, const char *datatype_in, const int overid int fd; char *dt; int size; - u_char *buff; + u_char *buff = NULL; struct stat file_stat; char *datatype = 0; diff --git a/cde/lib/DtSvc/DtUtil1/SmComm.c b/cde/lib/DtSvc/DtUtil1/SmComm.c index 100a15090..c7422ce5c 100644 --- a/cde/lib/DtSvc/DtUtil1/SmComm.c +++ b/cde/lib/DtSvc/DtUtil1/SmComm.c @@ -196,7 +196,7 @@ _DtSetSmState( Window smWindow, SmStateInfo *pSmStateInfo) { - int propStatus; + int propStatus = Success; PropDtSmStateInfo propSmStateInfo; PropDtSmStateInfo *pPropSmStateInfo; Atom xaDtSmStateInfo; diff --git a/cde/lib/DtSvc/DtUtil2/ChkpntListen.c b/cde/lib/DtSvc/DtUtil2/ChkpntListen.c index 38c97154c..2f5124e32 100644 --- a/cde/lib/DtSvc/DtUtil2/ChkpntListen.c +++ b/cde/lib/DtSvc/DtUtil2/ChkpntListen.c @@ -67,7 +67,7 @@ _DtPerfChkpntListenInit(Display *display, Window parentwin) #endif { Time timestamp = INVALID_TIME; - Window tmpwin; + Window tmpwin = 0; Bool bsuccess = False; _DtSvcProcessLock(); diff --git a/cde/lib/DtSvc/DtUtil2/Hash.c b/cde/lib/DtSvc/DtUtil2/Hash.c index cc2b78c04..c27c36a19 100644 --- a/cde/lib/DtSvc/DtUtil2/Hash.c +++ b/cde/lib/DtSvc/DtUtil2/Hash.c @@ -110,12 +110,12 @@ GetTableIndex( #endif /* NeedWidePrototypes */ { DtHashEntry *entries = tab->entries; - int len, idx, i, rehash = 0; + int len = 0, idx, i, rehash = 0; char c; Signature sig = 0; DtHashEntry entry; String s1, s2; - DtHashKey compKey; + DtHashKey compKey = NULL; if (tab->keyIsString) { s1 = (String)key; diff --git a/cde/lib/DtSvc/DtUtil2/SharedProcs.c b/cde/lib/DtSvc/DtUtil2/SharedProcs.c index c53f35e4b..395608d79 100644 --- a/cde/lib/DtSvc/DtUtil2/SharedProcs.c +++ b/cde/lib/DtSvc/DtUtil2/SharedProcs.c @@ -209,7 +209,7 @@ _DtMessageDialog( int dialogType ) { - Widget message; + Widget message = NULL; Widget widget; XmString message_string; XWindowAttributes attributes; diff --git a/cde/lib/DtSvc/DtUtil2/addToRes.c b/cde/lib/DtSvc/DtUtil2/addToRes.c index 7b9161328..8de1dbbb2 100644 --- a/cde/lib/DtSvc/DtUtil2/addToRes.c +++ b/cde/lib/DtSvc/DtUtil2/addToRes.c @@ -290,7 +290,7 @@ _DtGetEntries( int dosort ) { char *line, *colon, *temp, *str, *temp2; - Entry entry; + Entry entry = { NULL, NULL, 0, False }; int length; int lineno = 0;