Commit bb1fa1ef authored by Igor Sugak's avatar Igor Sugak Committed by Facebook Github Bot

fix use-of-uninitialized-value MSAN errors in RecordIOTest.cpp

Reviewed By: yfeldblum

Differential Revision: D19337438

fbshipit-source-id: 361322c02824c078a92b9cdd36ffacd0869580b0
parent d1403e66
...@@ -277,11 +277,11 @@ TEST(RecordIOTest, validateRecordAPI) { ...@@ -277,11 +277,11 @@ TEST(RecordIOTest, validateRecordAPI) {
buf->append(testSize); buf->append(testSize);
EXPECT_NE(buf, nullptr); EXPECT_NE(buf, nullptr);
auto wData = buf->writableData(); auto wData = buf->writableData();
if (testSize > hdrSize) { if (testSize >= hdrSize) {
// if the testSize is more than header size, populate databytes with // if the testSize is greater or equal than header size, populate buffer
// testChar // bytes with testChar
buf->trimStart(hdrSize); buf->trimStart(hdrSize);
memset(wData, testChar, buf->length()); memset(wData, testChar, buf->capacity());
recordio_helpers::prependHeader(buf, kTestFileId); recordio_helpers::prependHeader(buf, kTestFileId);
buf->unshare(); buf->unshare();
buf->coalesce(); buf->coalesce();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment