From 9d26729d654eedd4357fa4da8dae7d70af01ed43 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Fri, 26 Dec 2014 15:55:02 -0700 Subject: [PATCH] DtSvc/DtEncap: Coverity (memory corruption, moderate) --- cde/lib/DtSvc/DtEncap/spc-obj.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cde/lib/DtSvc/DtEncap/spc-obj.c b/cde/lib/DtSvc/DtEncap/spc-obj.c index f1980c24..9cfb3a34 100644 --- a/cde/lib/DtSvc/DtEncap/spc-obj.c +++ b/cde/lib/DtSvc/DtEncap/spc-obj.c @@ -198,7 +198,7 @@ SPC_Channel_Ptr SPC_Initialize_Channel(XeString hostname, int iomode) /*----------------------------------------------------------------------+*/ { - SPC_Channel_Ptr channel; + SPC_Channel_Ptr channel = NULL; /* Check for local or remote machine. If remote, create a remote channel object */ @@ -468,7 +468,8 @@ SPC_Channel_Ptr open_channel_object(SPC_Channel_Ptr channel, else channel->read_filter=channel->class_ptr->read; - channel->cid=(int)channel; + /* this (cid) should probably just be a long... */ + channel->cid=(int) ((long)channel & 0xffffffff); channel->identifier = Channel_Identifier; channel->IOMode = iomode; channel->wires[STDIN] = (&dummy_wire); -- 2.25.1