adding fix for crash when using effects with kasa devices

This commit is contained in:
Adam Kaczinski 2024-12-04 17:46:42 -08:00
parent b1d5e83adc
commit 48f0084a9f

View file

@ -314,7 +314,7 @@ bool KasaSmartController::SendCommand(std::string command, std::string &response
unsigned char* receive_buffer = new unsigned char[KASA_SMART_RECEIVE_BUFFER_SIZE];
int response_length = port.tcp_listen((char*)receive_buffer, KASA_SMART_RECEIVE_BUFFER_SIZE);
if(response_length > KASA_SMART_RECEIVE_BUFFER_SIZE) {
if(response_length > KASA_SMART_RECEIVE_BUFFER_SIZE || response_length <= 0) {
/*-------------------------------------------------------------*\
| Small fail safes to prevent decrypting bad or empty responses |
\*-------------------------------------------------------------*/