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;
   }