Commit 0c79c5f5 authored by reillyg's avatar reillyg Committed by Commit bot

Fix std::memset usage in blob_memory_controller_unittest.cc.

This change exchanges the 2nd and 3rd parameters to std::memset() in a
number of places where the value to set and the length of the buffer
were inverted. The resulting incompletely initialized buffers triggered
MSan failures.

BUG=375297
TBR=dmurph@chromium.org

Review-Url: https://chromiumcodereview.appspot.com/2447473002
Cr-Commit-Position: refs/heads/master@{#426966}
parent e84a2ecd
......@@ -218,7 +218,7 @@ TEST_F(BlobMemoryControllerTest, PageToDisk) {
SetTestMemoryLimits(&controller);
char kData[kTestBlobStorageMaxBlobMemorySize];
std::memset(kData, kTestBlobStorageMaxBlobMemorySize, 'e');
std::memset(kData, 'e', kTestBlobStorageMaxBlobMemorySize);
// Add memory item that is the memory quota.
BlobDataBuilder builder(kId);
......@@ -306,7 +306,7 @@ TEST_F(BlobMemoryControllerTest, CancelMemoryRequest) {
SetTestMemoryLimits(&controller);
char kData[kTestBlobStorageMaxBlobMemorySize];
std::memset(kData, kTestBlobStorageMaxBlobMemorySize, 'e');
std::memset(kData, 'e', kTestBlobStorageMaxBlobMemorySize);
// Add memory item that is the memory quota.
BlobDataBuilder builder(kId);
......@@ -366,7 +366,7 @@ TEST_F(BlobMemoryControllerTest, FileRequest) {
SetTestMemoryLimits(&controller);
char kData[kBlobSize];
std::memset(kData, kBlobSize, 'e');
std::memset(kData, 'e', kBlobSize);
// Add item that is the file quota.
BlobDataBuilder builder(kId);
......@@ -423,7 +423,7 @@ TEST_F(BlobMemoryControllerTest, CancelFileRequest) {
SetTestMemoryLimits(&controller);
char kData[kBlobSize];
std::memset(kData, kBlobSize, 'e');
std::memset(kData, 'e', kBlobSize);
// Add memory item that is the memory quota.
BlobDataBuilder builder(kId);
......@@ -607,7 +607,7 @@ TEST_F(BlobMemoryControllerTest, DisableDiskWithFileAndMemoryPending) {
SetTestMemoryLimits(&controller);
char kDataMemoryData[kFirstMemorySize];
std::memset(kDataMemoryData, kFirstMemorySize, 'e');
std::memset(kDataMemoryData, 'e', kFirstMemorySize);
// Add first memory item to fill up some memory quota.
BlobDataBuilder builder(kFirstMemoryId);
......
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