mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-17 16:43:53 +00: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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
SanitizationMemoryRangeWhitelist::Range ranges[list.size];
|
std::vector<SanitizationMemoryRangeWhitelist::Range> ranges(list.size);
|
||||||
if (!memory.Read(list.entries, sizeof(ranges), &ranges)) {
|
if (!memory.Read(list.entries, sizeof(ranges[0]) * list.size,
|
||||||
|
ranges.data())) {
|
||||||
LOG(ERROR) << "Failed to read memory range whitelist entries.";
|
LOG(ERROR) << "Failed to read memory range whitelist entries.";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user