Commit 16934f32 authored by sergeyu@chromium.org's avatar sergeyu@chromium.org

Fix valgrind warning in remoting_unittests due to uninitialized memory.

Review URL: http://codereview.chromium.org/8930016

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114278 0039d316-1c4b-4281-b951-d872f2087c98
parent c2e81fdd
...@@ -59,6 +59,9 @@ void StreamConnectionTester::Done() { ...@@ -59,6 +59,9 @@ void StreamConnectionTester::Done() {
void StreamConnectionTester::InitBuffers() { void StreamConnectionTester::InitBuffers() {
output_buffer_ = new net::DrainableIOBuffer( output_buffer_ = new net::DrainableIOBuffer(
new net::IOBuffer(test_data_size_), test_data_size_); new net::IOBuffer(test_data_size_), test_data_size_);
for (int i = 0; i < test_data_size_; ++i) {
output_buffer_->data()[i] = static_cast<char>(i);
}
input_buffer_ = new net::GrowableIOBuffer(); input_buffer_ = new net::GrowableIOBuffer();
} }
...@@ -175,7 +178,9 @@ void DatagramConnectionTester::DoWrite() { ...@@ -175,7 +178,9 @@ void DatagramConnectionTester::DoWrite() {
} }
scoped_refptr<net::IOBuffer> packet(new net::IOBuffer(message_size_)); scoped_refptr<net::IOBuffer> packet(new net::IOBuffer(message_size_));
memset(packet->data(), 123, message_size_); for (int i = 0; i < message_size_; ++i) {
packet->data()[i] = static_cast<char>(i);
}
sent_packets_[packets_sent_] = packet; sent_packets_[packets_sent_] = packet;
// Put index of this packet in the beginning of the packet body. // Put index of this packet in the beginning of the packet body.
memcpy(packet->data(), &packets_sent_, sizeof(packets_sent_)); memcpy(packet->data(), &packets_sent_, sizeof(packets_sent_));
......
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