Add a size check to the client on controller data receiving
This commit is contained in:
parent
64a0d2c061
commit
44268596b3
1 changed files with 27 additions and 20 deletions
|
|
@ -556,7 +556,13 @@ void NetworkClient::ProcessReply_ControllerCount(unsigned int data_size, char *
|
|||
}
|
||||
}
|
||||
|
||||
void NetworkClient::ProcessReply_ControllerData(unsigned int /*data_size*/, char * data, unsigned int dev_idx)
|
||||
void NetworkClient::ProcessReply_ControllerData(unsigned int data_size, char * data, unsigned int dev_idx)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Verify the controller description size (first 4 bytes of |
|
||||
| data) matches the packet size in the header |
|
||||
\*---------------------------------------------------------*/
|
||||
if(data_size == *((unsigned int*)data))
|
||||
{
|
||||
RGBController_Network * new_controller = new RGBController_Network(this, dev_idx);
|
||||
|
||||
|
|
@ -582,6 +588,7 @@ void NetworkClient::ProcessReply_ControllerData(unsigned int /*data_size*/, char
|
|||
|
||||
controller_data_received = true;
|
||||
}
|
||||
}
|
||||
|
||||
void NetworkClient::ProcessReply_ProtocolVersion(unsigned int data_size, char * data)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue