Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(643)

Unified Diff: minidump/minidump_module_writer.cc

Issue 983103004: win: fixes for Windows x64 (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: mac Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: minidump/minidump_module_writer.cc
diff --git a/minidump/minidump_module_writer.cc b/minidump/minidump_module_writer.cc
index f932422cca13344030e2b537833bb783f437a918..dc5eddfa6e6a3ea8a9ab8ae8d141b7bcb79c1618 100644
--- a/minidump/minidump_module_writer.cc
+++ b/minidump/minidump_module_writer.cc
@@ -19,6 +19,7 @@
#include <limits>
#include "base/logging.h"
+#include "base/numerics/safe_conversions.h"
#include "minidump/minidump_string_writer.h"
#include "minidump/minidump_writer_util.h"
#include "snapshot/module_snapshot.h"
@@ -154,13 +155,14 @@ bool MinidumpModuleMiscDebugRecordWriter::Freeze() {
// NUL-terminate.
if (!image_debug_misc_.Unicode) {
DCHECK(data_utf16_.empty());
- image_debug_misc_.Length = offsetof(decltype(image_debug_misc_), Data) +
- (data_.size() + 1) * sizeof(data_[0]);
+ image_debug_misc_.Length = base::checked_cast<uint32_t>(
+ offsetof(decltype(image_debug_misc_), Data) +
+ (data_.size() + 1) * sizeof(data_[0]));
} else {
DCHECK(data_.empty());
- image_debug_misc_.Length =
+ image_debug_misc_.Length = base::checked_cast<uint32_t>(
offsetof(decltype(image_debug_misc_), Data) +
- (data_utf16_.size() + 1) * sizeof(data_utf16_[0]);
+ (data_utf16_.size() + 1) * sizeof(data_utf16_[0]));
}
return true;
« no previous file with comments | « minidump/minidump_module_crashpad_info_writer_test.cc ('k') | minidump/minidump_simple_string_dictionary_writer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698