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

Commit4db8959

Browse files
committed
test: fix buffer overflow in String::getBytes test
1 parent5b9faf6 commit4db8959

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::Stringstr("Hello");
48-
unsignedchar buf[2];
48+
unsignedchar 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)

[8]ページ先頭

©2009-2025 Movatter.jp