Fix out of bounds access in test.
The test code constructed an `std::string` without a size from a non-terminated string, which causes a memory error. Test: atest 'DefaultVhalImplTest#testDump' on flame_hwasan Bug: 233677013 Change-Id: I7d27c009c2e3307895a4a741743332fd4eed0e24
This commit is contained in:
parent
852411b922
commit
e4ffd01586
1 changed files with 1 additions and 1 deletions
|
@ -402,7 +402,7 @@ TEST_F(DefaultVhalImplTest, testDump) {
|
|||
gotValue->timestamp = 0;
|
||||
|
||||
std::string infoMake = toString(*gotValue);
|
||||
EXPECT_THAT(std::string(buf), HasSubstr(infoMake));
|
||||
EXPECT_THAT(std::string(buf, sizeof(buf)), HasSubstr(infoMake));
|
||||
}
|
||||
|
||||
TEST_F(DefaultVhalImplTest, testSetPropInvalidAreaId) {
|
||||
|
|
Loading…
Reference in a new issue