commit | c6b305f5648786ea4854d3e40538b74bdbdbb9fd | [log] [tgz] |
---|---|---|
author | Eric Astor <epastor@google.com> | Tue Jun 23 10:02:16 2020 -0400 |
committer | Copybara-Service <copybara-worker@google.com> | Tue Jan 19 07:10:01 2021 -0800 |
tree | eefbbf79612b888c3ca57735781ece4fe60cf8f6 | |
parent | 7dc599137ecedfe348376ab0bac8a7cd44427846 [diff] |
Avoid use of variable-length arrays when not necessary Change-Id: If8b0a68ab2d8f0502874801669c5d89cb59aebd5 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2259335 Reviewed-by: Mark Mentovai <mark@chromium.org> GitOrigin-RevId: d9c3e7cb3684d863496ec9c17b77a5146e4bc936
diff --git a/snapshot/sanitized/sanitization_information.cc b/snapshot/sanitized/sanitization_information.cc index 5f7756f..325365b 100644 --- a/snapshot/sanitized/sanitization_information.cc +++ b/snapshot/sanitized/sanitization_information.cc
@@ -88,8 +88,9 @@ 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; }