Closed
Description
The relevant code is in the link below. The buffer size is 256 but the the method accepts a size_t len. What happens if len is greater than 256?
https://github.com/arduino/ArduinoCore-mbed/blob/main/libraries/Wire/Wire.cpp#L94
size_t arduino::MbedI2C::requestFrom(uint8_t address, size_t len, bool stopBit) {
char buf[256];
int ret = master->read(address << 1, buf, len, !stopBit);
if (ret != 0) {
return 0;
}
for (size_t i=0; i<len; i++) {
rxBuffer.store_char(buf[i]);
}
return len;
}