Call to ics.find_devices wit a device_type filter value is broken (undefined behavior) due to wrong array reset argument.
For example this code will have a undefined behavior (will seg fault most of the times)
for device in ics.find_devices([ics.NEODEVICE_FIRE, ics.NEODEVICE_VCAN3]):
print(device.Name, device.SerialNumber)
|
device_types_list.reset((new unsigned int(device_types_list_size))); |
std::unique_ptr<unsigned int[]> requires an array-new expression (new T[n]), but the code uses new unsigned int(device_types_list_size), which allocates a single unsigned int initialized to the size value. Subsequent accesses via device_types_list[i] for i > 0 are undefined behavior.
Call to
ics.find_deviceswit adevice_typefilter value is broken (undefined behavior) due to wrong array reset argument.For example this code will have a undefined behavior (will seg fault most of the times)
python_ics/src/methods.cpp
Line 1057 in 0849947
std::unique_ptr<unsigned int[]>requires an array-new expression (new T[n]), but the code usesnew unsigned int(device_types_list_size), which allocates a singleunsigned intinitialized to the size value. Subsequent accesses viadevice_types_list[i]fori > 0are undefined behavior.