Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Side by Side Diff: util/mach/exc_client_variants.cc

Issue 1283323010: asan: Fix invalid memory access in UniversalExceptionRaise() (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Crashpad Authors. All rights reserved. 1 // Copyright 2014 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 27 matching lines...) Expand all
38 // exception_deliver() as far as the delivery logic is concerned. Unlike 38 // exception_deliver() as far as the delivery logic is concerned. Unlike
39 // exception_deliver(), this function does not get or set thread states for 39 // exception_deliver(), this function does not get or set thread states for
40 // behavior values that require this, as that is left to the caller to do if 40 // behavior values that require this, as that is left to the caller to do if
41 // needed. 41 // needed.
42 42
43 std::vector<exception_data_type_t> small_code_vector; 43 std::vector<exception_data_type_t> small_code_vector;
44 exception_data_t small_code = nullptr; 44 exception_data_t small_code = nullptr;
45 if ((behavior & MACH_EXCEPTION_CODES) == 0 && code_count) { 45 if ((behavior & MACH_EXCEPTION_CODES) == 0 && code_count) {
46 small_code_vector.reserve(code_count); 46 small_code_vector.reserve(code_count);
47 for (size_t code_index = 0; code_index < code_count; ++code_index) { 47 for (size_t code_index = 0; code_index < code_count; ++code_index) {
48 small_code_vector[code_index] = code[code_index]; 48 small_code_vector.push_back(code[code_index]);
49 } 49 }
50 small_code = &small_code_vector[0]; 50 small_code = &small_code_vector[0];
51 } 51 }
52 52
53 // The *exception_raise*() family has bad declarations. Their code and 53 // The *exception_raise*() family has bad declarations. Their code and
54 // old_state arguments aren’t pointers to const data, although they should be. 54 // old_state arguments aren’t pointers to const data, although they should be.
55 // The generated stubs in excUser.c and mach_excUser.c make it clear that the 55 // The generated stubs in excUser.c and mach_excUser.c make it clear that the
56 // data is never modified, and these parameters could be declared with const 56 // data is never modified, and these parameters could be declared with const
57 // appropriately. The uses of const_cast below are thus safe. 57 // appropriately. The uses of const_cast below are thus safe.
58 58
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 new_state, 120 new_state,
121 new_state_count); 121 new_state_count);
122 122
123 default: 123 default:
124 NOTREACHED(); 124 NOTREACHED();
125 return KERN_INVALID_ARGUMENT; 125 return KERN_INVALID_ARGUMENT;
126 } 126 }
127 } 127 }
128 128
129 } // namespace crashpad 129 } // namespace crashpad
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698