From c62f7b6883e99d0a004c69ecd93eff0280a8d1ab Mon Sep 17 00:00:00 2001 From: gizmocuz Date: Sun, 16 Apr 2017 09:30:13 +0200 Subject: [PATCH] Fixed crash when data_length equals 0 --- cpp/src/command_classes/ManufacturerSpecific.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cpp/src/command_classes/ManufacturerSpecific.cpp b/cpp/src/command_classes/ManufacturerSpecific.cpp index 8fb27775ad..973ac588f1 100644 --- a/cpp/src/command_classes/ManufacturerSpecific.cpp +++ b/cpp/src/command_classes/ManufacturerSpecific.cpp @@ -257,6 +257,8 @@ bool ManufacturerSpecific::HandleMsg uint8 deviceIDType = (_data[1] & 0x07); uint8 dataFormat = (_data[2] & 0xe0)>>0x05; uint8 data_length = (_data[2] & 0x1f); + if (data_length==0) + return false; uint8 const* deviceIDData = &_data[3]; string deviceID = ""; for (int i=0; i