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
Fix buffer-overflow assigning global Wire instances.
Two pointer arrays declared, which contain pointers to the global SCI/I2C Wire instances: "g_SCIWires" and "g_I2CWires". Since there's a different number of SCI vs pure I2C "I2C" interfaces those buffers are of different size. Due to a typo the constant declaring the size of the pointe rarray for "g_SCIWires" ("TWOWIRE_MAX_SCI_CHANNELS") was used to define the size of "g_I2CWires" and vice versa. This had the result that on Portenta C33, íf you were calling "TwoWire::_begin()" for "Wire3" (which has channel "3") a buffer overflow occurs and random memory is overwritten.
0 commit comments