From 0ea32e0c7bc2569e597e412a20151ad8a7e64623 Mon Sep 17 00:00:00 2001 From: Joshua Peraza Date: Mon, 20 Dec 2021 12:57:44 -0800 Subject: [PATCH] linux: initialize padding bytes in tests for msan Bug: chromium:1281317 Change-Id: I83a50b851e9648e5270793c9149206103ac40ed1 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3350751 Reviewed-by: Justin Cohen Commit-Queue: Joshua Peraza --- client/crashpad_client_linux_test.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/crashpad_client_linux_test.cc b/client/crashpad_client_linux_test.cc index ddf15390..1ab974e7 100644 --- a/client/crashpad_client_linux_test.cc +++ b/client/crashpad_client_linux_test.cc @@ -90,6 +90,9 @@ class StartHandlerForSelfTest ~StartHandlerForSelfTest() = default; void SetUp() override { + // MSAN requires that padding bytes have been initialized for structs that + // are written to files. + memset(&options_, 0, sizeof(options_)); std::tie(options_.start_handler_at_crash, options_.set_first_chance_handler, options_.crash_non_main_thread,