Possible out of buffer access
krzysiekkajot opened this issue · comments
krzysiekkajot commented
Hi
in legoino/src/Lpf2Hub.cpp, line 82 there is a code:
if (manufacturerDataLength >= 3) <-- check if buffer is at least 3 characters length
{
log_d("manufacturer data hub type: %x", manufacturerData[3]);
//check device type ID
switch (manufacturerData[3]) <-- accessing 4th element in the buffer
should be line 82 changed to: if (manufacturerDataLength >= 4) ?