summaryrefslogtreecommitdiffstats
path: root/base/debug/stack_trace_win.cc
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-25 21:43:44 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-25 21:43:44 +0000
commite645c7af7a0cb3d4c18bb65c646a0117e6201b80 (patch)
tree4e2df5c79a0e1691dda1cddeff4db1675efdf102 /base/debug/stack_trace_win.cc
parentc6d3499beca9af304446e530b80e66a2ed040622 (diff)
downloadchromium_src-e645c7af7a0cb3d4c18bb65c646a0117e6201b80.zip
chromium_src-e645c7af7a0cb3d4c18bb65c646a0117e6201b80.tar.gz
chromium_src-e645c7af7a0cb3d4c18bb65c646a0117e6201b80.tar.bz2
Coverity: Fully initialize the |trace_| member variable.
Also changed the type of |count_| to size_t since it's a size variable. CID_COUNT=1 CID=13504 BUG=none TEST=none R=brettw Review URL: https://chromiumcodereview.appspot.com/10834006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148420 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/debug/stack_trace_win.cc')
-rw-r--r--base/debug/stack_trace_win.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/base/debug/stack_trace_win.cc b/base/debug/stack_trace_win.cc
index 3332979..8069da7 100644
--- a/base/debug/stack_trace_win.cc
+++ b/base/debug/stack_trace_win.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -23,7 +23,7 @@ namespace {
// of functions. The Sym* family of functions may only be invoked by one
// thread at a time. SymbolContext code may access a symbol server over the
// network while holding the lock for this singleton. In the case of high
-// latency, this code will adversly affect performance.
+// latency, this code will adversely affect performance.
//
// There is also a known issue where this backtrace code can interact
// badly with breakpad if breakpad is invoked in a separate thread while
@@ -57,7 +57,7 @@ class SymbolContext {
// LOG(FATAL) here because this code is called might be triggered by a
// LOG(FATAL) itself.
void OutputTraceToStream(const void* const* trace,
- int count,
+ size_t count,
std::ostream* os) {
base::AutoLock lock(lock_);
@@ -95,7 +95,7 @@ class SymbolContext {
(*os) << symbol->Name << " [0x" << trace[i] << "+"
<< sym_displacement << "]";
} else {
- // If there is no symbol informtion, add a spacer.
+ // If there is no symbol information, add a spacer.
(*os) << "(No symbol) [0x" << trace[i] << "]";
}
if (has_line) {
@@ -185,6 +185,9 @@ StackTrace::StackTrace(EXCEPTION_POINTERS* exception_pointers) {
count_ < arraysize(trace_)) {
trace_[count_++] = reinterpret_cast<void*>(stack_frame.AddrPC.Offset);
}
+
+ for (size_t i = count_; i < arraysize(trace_); ++i)
+ trace_[i] = NULL;
}
void StackTrace::PrintBacktrace() const {