You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.
Thank you for your library.
I used it in a project and stumbled upon an issue on high data rates.
I found two problems in the WireSlaveRequest.cpp where memory is accessed in an array without range checking the index.
I solved the problem by changing the line while (unpacker.available()) in the bool WireSlaveRequest::request(uint8_t address) function to while ((unpacker.available()) && (rxIndex_ < UNPACKER_BUFFER_LENGTH))
and line if (lastStatus_ == PACKET_READ && rxIndex_ < rxLength_) in the int WireSlaveRequest::read() function to if (lastStatus_ == PACKET_READ && rxIndex_ < rxLength_ && (rxIndex_ < UNPACKER_BUFFER_LENGTH))
I will create a pull request with this fix.
The text was updated successfully, but these errors were encountered:
TylerBird
added a commit
to TylerBird/ESP32_I2C_Slave
that referenced
this issue
Oct 13, 2020
Thank you for your library.
I used it in a project and stumbled upon an issue on high data rates.
I found two problems in the
WireSlaveRequest.cpp
where memory is accessed in an array without range checking the index.I solved the problem by changing the line
while (unpacker.available())
in thebool WireSlaveRequest::request(uint8_t address)
function towhile ((unpacker.available()) && (rxIndex_ < UNPACKER_BUFFER_LENGTH))
and line
if (lastStatus_ == PACKET_READ && rxIndex_ < rxLength_)
in theint WireSlaveRequest::read()
function toif (lastStatus_ == PACKET_READ && rxIndex_ < rxLength_ && (rxIndex_ < UNPACKER_BUFFER_LENGTH))
I will create a pull request with this fix.
The text was updated successfully, but these errors were encountered: