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 4db8959

Browse files
committed
test: fix buffer overflow in String::getBytes test
1 parent 5b9faf6 commit 4db8959

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎test/src/String/test_characterAccessFunc.cpp‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ TEST_CASE ("Testing String::getBytes(unsigned char, unsigned int, unsigned int)"
4545

4646
WHEN("Valid operation") {
4747
arduino::String str("Hello");
48-
unsigned char buf[2];
48+
unsigned char buf[3];
4949
str.getBytes(buf, 5, 3);
5050
REQUIRE(buf[0] == 'l');
5151
REQUIRE(buf[1] == 'o');
52+
REQUIRE(buf[2] == '0円');
5253
}
5354
}
5455

0 commit comments

Comments
(0)

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