Skip to content

Commit 2b5a040

Browse files
SidLeungBrian Baltz
authored and
Brian Baltz
committed
Bug fixed: CurieBle library, class BLECharacteristic allocates memory using an incorrect variable which may result in memory corruption if the memory size is bigger than 16 bytes.
1 parent cdd2989 commit 2b5a040

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/CurieBLE/src/BLECharacteristic.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ BLECharacteristic::BLECharacteristic(const char* uuid,
3737
_presentation_format(NULL)
3838
{
3939
_value_size = maxLength > BLE_MAX_ATTR_DATA_LEN ? BLE_MAX_ATTR_DATA_LEN : maxLength;
40-
_value = (unsigned char*)malloc(_value_length);
40+
_value = (unsigned char*)malloc(_value_size);
4141

4242
memset(_event_handlers, 0, sizeof(_event_handlers));
4343
}

0 commit comments

Comments
 (0)