mirror of
https://github.com/chromium/crashpad.git
synced 2024-12-25 22:30:49 +08:00
Avoid assuming string_view iterators are char*
This assumption is non-portable and prevents Chromium from using bounded iterators in libc++. Bug: chromium: 1519908 Change-Id: Iafe6639ef3bc896d6fa4fb3ceb7ac0b546363017 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5237292 Reviewed-by: Mark Mentovai <mark@chromium.org> Commit-Queue: danakj <danakj@chromium.org>
This commit is contained in:
parent
22c386d1ac
commit
a02e4935bd
@ -299,14 +299,11 @@ bool StringToExceptionMask(const base::StringPiece& string,
|
||||
size_t pos = -1;
|
||||
do {
|
||||
++pos;
|
||||
const char* substring_begin = string.begin() + pos;
|
||||
const size_t start = pos;
|
||||
pos = string.find('|', pos);
|
||||
const char* substring_end = (pos == base::StringPiece::npos)
|
||||
? string.end()
|
||||
: (string.begin() + pos);
|
||||
base::StringPiece substring = string.substr(
|
||||
substring_begin - string.begin(), substring_end - substring_begin);
|
||||
|
||||
base::StringPiece substring = (pos == base::StringPiece::npos)
|
||||
? string.substr(start)
|
||||
: string.substr(start, pos - start);
|
||||
exception_mask_t temp_mask;
|
||||
if (!StringToExceptionMask(substring, options, &temp_mask)) {
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user