corneliusmunz / legoino

Arduino Library for controlling Powered UP and Boost controllers
MIT License
257 stars 34 forks source link

Possible out of buffer access #78

Open krzysiekkajot opened 11 months ago

krzysiekkajot commented 11 months ago

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) ?