Fix error r1258.

BUG=556
R=cdn@chromium.org, mark@chromium.org

Review URL: https://breakpad.appspot.com/904004

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1262 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
thestig@chromium.org 2013-12-17 19:04:11 +00:00
parent d6d6230272
commit a4d055f1c2

View File

@ -437,10 +437,10 @@ bool MinidumpGenerator::WriteMinidump(
breakpad_info.requesting_thread_id = requesting_thread_id; breakpad_info.requesting_thread_id = requesting_thread_id;
} }
int additional_streams_count = additional_streams ?
additional_streams->UserStreamCount : 0;
scoped_array<MINIDUMP_USER_STREAM> user_stream_array( scoped_array<MINIDUMP_USER_STREAM> user_stream_array(
new MINIDUMP_USER_STREAM[3 + additional_streams ? new MINIDUMP_USER_STREAM[3 + additional_streams_count]);
additional_streams->UserStreamCount :
0]);
user_stream_array[0].Type = MD_BREAKPAD_INFO_STREAM; user_stream_array[0].Type = MD_BREAKPAD_INFO_STREAM;
user_stream_array[0].BufferSize = sizeof(breakpad_info); user_stream_array[0].BufferSize = sizeof(breakpad_info);
user_stream_array[0].Buffer = &breakpad_info; user_stream_array[0].Buffer = &breakpad_info;
@ -484,15 +484,17 @@ bool MinidumpGenerator::WriteMinidump(
++user_streams.UserStreamCount; ++user_streams.UserStreamCount;
} }
for (size_t i = 0; if (additional_streams) {
additional_streams != NULL, i < additional_streams->UserStreamCount; for (size_t i = 0;
i++, user_streams.UserStreamCount++) { i < additional_streams->UserStreamCount;
user_stream_array[user_streams.UserStreamCount].Type = i++, user_streams.UserStreamCount++) {
additional_streams->UserStreamArray[i].Type; user_stream_array[user_streams.UserStreamCount].Type =
user_stream_array[user_streams.UserStreamCount].BufferSize = additional_streams->UserStreamArray[i].Type;
additional_streams->UserStreamArray[i].BufferSize; user_stream_array[user_streams.UserStreamCount].BufferSize =
user_stream_array[user_streams.UserStreamCount].Buffer = additional_streams->UserStreamArray[i].BufferSize;
additional_streams->UserStreamArray[i].Buffer; user_stream_array[user_streams.UserStreamCount].Buffer =
additional_streams->UserStreamArray[i].Buffer;
}
} }
// If the process is terminated by STATUS_INVALID_HANDLE exception store // If the process is terminated by STATUS_INVALID_HANDLE exception store