From: Mika Laitio Date: Sun, 6 Mar 2011 08:42:52 +0000 (+0200) Subject: Crash fix for unhandled msg request case in server. X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=f5c7f7f3ac73c1caaf655127ecf708d49509d6a8;p=libplpbus.git Crash fix for unhandled msg request case in server. Fixed the bus msg response crash in case when the server did not handle the message and returned null. Signed-off-by: Mika Laitio --- diff --git a/src/plpbus/OrbServerImpl.cc b/src/plpbus/OrbServerImpl.cc index 1c8bfb5..3fa74a0 100644 --- a/src/plpbus/OrbServerImpl.cc +++ b/src/plpbus/OrbServerImpl.cc @@ -105,11 +105,16 @@ CORBA::Long OrbServerImpl::send_dataitem_message_and_wait_response(const DataIte BusMessage *msg_rsp; DataItemSequence *seq; - msg_req = new BusMessageInternal(req_seq_param); + seq = NULL; msg_rsp = NULL; + msg_req = new BusMessageInternal(req_seq_param); _listener->request_received(msg_req, &msg_rsp); - //rsp_seq_param = new DataItemSequence_out(msg_rsp._dataItemSeq); - seq = (DataItemSequence *)msg_rsp->_dataItemSeq; + if (msg_rsp != NULL) { + seq = (DataItemSequence *)msg_rsp->_dataItemSeq; + } + else { + seq = new DataItemSequence(); + } rsp_seq_param._data = seq; return 0;