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,8 +484,9 @@ bool MinidumpGenerator::WriteMinidump(
++user_streams.UserStreamCount; ++user_streams.UserStreamCount;
} }
if (additional_streams) {
for (size_t i = 0; for (size_t i = 0;
additional_streams != NULL, i < additional_streams->UserStreamCount; i < additional_streams->UserStreamCount;
i++, user_streams.UserStreamCount++) { i++, user_streams.UserStreamCount++) {
user_stream_array[user_streams.UserStreamCount].Type = user_stream_array[user_streams.UserStreamCount].Type =
additional_streams->UserStreamArray[i].Type; additional_streams->UserStreamArray[i].Type;
@ -494,6 +495,7 @@ bool MinidumpGenerator::WriteMinidump(
user_stream_array[user_streams.UserStreamCount].Buffer = user_stream_array[user_streams.UserStreamCount].Buffer =
additional_streams->UserStreamArray[i].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
// the trace of operations for the offending handle value. Do nothing special // the trace of operations for the offending handle value. Do nothing special