Movatterモバイル変換


[0]ホーム

URL:


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

Commit2d27acf

Browse files
authored
Merge pull request#872 from iabdalkader/wire_buffer_overflow
Wire: Fix buffer overflow in requestFrom.
2 parents59ec204 +7154337 commit2d27acf

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

‎libraries/Wire/Wire.cpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ uint8_t arduino::MbedI2C::endTransmission(void) {
9393

9494
size_tarduino::MbedI2C::requestFrom(uint8_t address,size_t len,bool stopBit) {
9595
char buf[256];
96+
len =min(len,sizeof(buf));
9697
int ret = master->read(address <<1, buf, len, !stopBit);
9798
if (ret !=0) {
9899
return0;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp