X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8aea37a9df3a2f5ca949ff466bbf698a4b2e3062..d31d30d791201146a5e224d3bf0f0cd909300bba:/src/common/sckipc.cpp?ds=sidebyside diff --git a/src/common/sckipc.cpp b/src/common/sckipc.cpp index ff7ebbcc2a..14526474d7 100644 --- a/src/common/sckipc.cpp +++ b/src/common/sckipc.cpp @@ -680,16 +680,21 @@ void wxTCPEventHandler::Client_OnRequest(wxSocketEvent &event) const wxString topic = connection->m_topic; wxString item; - switch ( const int msg = streams->Read8() ) + bool error = false; + + const int msg = streams->Read8(); + switch ( msg ) { case IPC_EXECUTE: { wxIPCFormat format; - size_t size; + size_t size wxDUMMY_INITIALIZE(0); void * const data = streams->ReadFormatData(connection, &format, &size); - - connection->OnExecute(topic, data, size, format); + if ( data ) + connection->OnExecute(topic, data, size, format); + else + error = true; } break; @@ -698,11 +703,14 @@ void wxTCPEventHandler::Client_OnRequest(wxSocketEvent &event) item = streams->ReadString(); wxIPCFormat format; - size_t size; + size_t size wxDUMMY_INITIALIZE(0); void * const data = streams->ReadFormatData(connection, &format, &size); - connection->OnAdvise(topic, item, data, size, format); + if ( data ) + connection->OnAdvise(topic, item, data, size, format); + else + error = true; } break; @@ -731,10 +739,13 @@ void wxTCPEventHandler::Client_OnRequest(wxSocketEvent &event) item = streams->ReadString(); wxIPCFormat format = (wxIPCFormat)streams->Read8(); - size_t size; + size_t size wxDUMMY_INITIALIZE(0); void * const data = streams->ReadData(connection, &size); - connection->OnPoke(topic, item, data, size, format); + if ( data ) + connection->OnPoke(topic, item, data, size, format); + else + error = true; } break; @@ -788,9 +799,12 @@ void wxTCPEventHandler::Client_OnRequest(wxSocketEvent &event) default: wxLogDebug("Unknown message code %d received.", msg); - IPCOutput(streams).Write8(IPC_FAIL); + error = true; break; } + + if ( error ) + IPCOutput(streams).Write8(IPC_FAIL); } void wxTCPEventHandler::Server_OnRequest(wxSocketEvent &event)