(WV to Android) Fix un-initialized-value warning as error in odk_test

Merge from Widevine repo of http://go/wvgerrit/95968

Un-initialized int array allocated on heap is detected by MemorySanitizer using this command:

rabbit test --config=msan --keep_going --compilation_mode=opt --runs_per_test=1 //video/widevine/export/common/oemcrypto_core_message/odk:odk_test

Bug: 151339875
Test: cdm and odk unit tests
Change-Id: Ic3329b918636a58eccb518ded7b262c4d98c3644
This commit is contained in:
Cong Lin
2020-03-17 13:53:22 -07:00
parent 7cd0aacedb
commit 78fddc230a
2 changed files with 7 additions and 7 deletions

View File

@@ -477,7 +477,7 @@ void ODK_BuildMessageBuffer(ODK_CoreMessage* core_message,
// update message_size
*(reinterpret_cast<uint32_t*>(total_fields[1].value)) = *buf_size;
*buf = new uint8_t[*buf_size];
*buf = new uint8_t[*buf_size]{};
size_t bytes_written = 0;
// serialize ODK fields to message buffer
EXPECT_EQ(OEMCrypto_SUCCESS, ODK_IterFields(ODK_WRITE, *buf, SIZE_MAX,