Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9029d7d

Browse files
Merge pull request #317 from arduino/fix-buffer-overflow
Fix buffer-overflow assigning global Wire instances.
2 parents fe72ebf + 68f924b commit 9029d7d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎libraries/Wire/Wire.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ extern "C" {
3030

3131
#include "Wire.h"
3232

33-
TwoWire *TwoWire::g_SCIWires[TWOWIRE_MAX_I2C_CHANNELS] = {nullptr};
34-
TwoWire *TwoWire::g_I2CWires[TWOWIRE_MAX_SCI_CHANNELS] = {nullptr};
33+
TwoWire *TwoWire::g_SCIWires[TWOWIRE_MAX_SCI_CHANNELS] = {nullptr};
34+
TwoWire *TwoWire::g_I2CWires[TWOWIRE_MAX_I2C_CHANNELS] = {nullptr};
3535

3636
/* -------------------------------------------------------------------------- */
3737
void TwoWire::setBusStatus(WireStatus_t ws) {

‎libraries/Wire/Wire.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ class TwoWire : public arduino::HardwareI2C {
152152

153153
private:
154154

155-
static TwoWire *g_SCIWires[TWOWIRE_MAX_I2C_CHANNELS];
156-
static TwoWire *g_I2CWires[TWOWIRE_MAX_SCI_CHANNELS];
155+
static TwoWire *g_SCIWires[TWOWIRE_MAX_SCI_CHANNELS];
156+
static TwoWire *g_I2CWires[TWOWIRE_MAX_I2C_CHANNELS];
157157

158158
static void WireSCIMasterCallback(i2c_master_callback_args_t *);
159159
static void WireMasterCallback(i2c_master_callback_args_t *);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /