RemoteMessage: Guard against NULL source/target.
To make it more obvious in case it is ever used the wrong way.
This commit is contained in:
parent
703667a98d
commit
4d9d6d7ee3
@ -228,7 +228,7 @@ RemoteHWInterface::_EventThreadEntry(void* data)
|
||||
status_t
|
||||
RemoteHWInterface::_EventThread()
|
||||
{
|
||||
RemoteMessage message(fReceiveBuffer, fSendBuffer);
|
||||
RemoteMessage message(fReceiveBuffer, NULL);
|
||||
while (true) {
|
||||
uint16 code;
|
||||
status_t result = message.NextMessage(code);
|
||||
|
@ -239,7 +239,7 @@ RemoteMessage::Start(uint16 code)
|
||||
inline status_t
|
||||
RemoteMessage::Flush()
|
||||
{
|
||||
if (fWriteIndex == 0)
|
||||
if (fWriteIndex == 0 || fTarget == NULL)
|
||||
return B_NO_INIT;
|
||||
|
||||
uint32 length = fWriteIndex;
|
||||
@ -304,6 +304,9 @@ RemoteMessage::Read(T& value)
|
||||
if (fDataLeft < sizeof(T))
|
||||
return B_ERROR;
|
||||
|
||||
if (fSource == NULL)
|
||||
return B_NO_INIT;
|
||||
|
||||
int32 readSize = fSource->Read(&value, sizeof(T));
|
||||
if (readSize < 0)
|
||||
return readSize;
|
||||
|
Loading…
Reference in New Issue
Block a user