mirror of
https://github.com/chromium/crashpad.git
synced 2024-12-27 15:32:10 +08:00
Avoid use of variable-length arrays when not necessary
Change-Id: I45872ed02bbcf49b2709276dbb38cf72fab5cb1c Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2259335 Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
parent
ca0fd934d9
commit
d9c3e7cb36
@ -88,8 +88,9 @@ bool ReadMemoryRangeWhitelist(
|
||||
return false;
|
||||
}
|
||||
|
||||
SanitizationMemoryRangeWhitelist::Range ranges[list.size];
|
||||
if (!memory.Read(list.entries, sizeof(ranges), &ranges)) {
|
||||
std::vector<SanitizationMemoryRangeWhitelist::Range> ranges(list.size);
|
||||
if (!memory.Read(list.entries, sizeof(ranges[0]) * list.size,
|
||||
ranges.data())) {
|
||||
LOG(ERROR) << "Failed to read memory range whitelist entries.";
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user