summaryrefslogtreecommitdiffstats
path: root/base/debug_util_win.cc
diff options
context:
space:
mode:
authormaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-27 15:54:05 +0000
committermaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-27 15:54:05 +0000
commitb3f97bc7bb26c47a37a2403f0edf9dc51443359c (patch)
tree491068650bb4fa51db7085cffae7736f79a78b7e /base/debug_util_win.cc
parentb78edc61aa9320139b49bb79d04ae0822d9243c7 (diff)
downloadchromium_src-b3f97bc7bb26c47a37a2403f0edf9dc51443359c.zip
chromium_src-b3f97bc7bb26c47a37a2403f0edf9dc51443359c.tar.gz
chromium_src-b3f97bc7bb26c47a37a2403f0edf9dc51443359c.tar.bz2
0-initialize the function dump.
Otherwise the string is not null-terminated when it's >255 chars. TEST=none BUG=none Review URL: http://codereview.chromium.org/334045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30198 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/debug_util_win.cc')
-rw-r--r--base/debug_util_win.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/base/debug_util_win.cc b/base/debug_util_win.cc
index 8adbf8f..9e7b444 100644
--- a/base/debug_util_win.cc
+++ b/base/debug_util_win.cc
@@ -121,12 +121,13 @@ class SymbolContext {
kMaxNameLength * sizeof(wchar_t) +
sizeof(ULONG64) - 1) /
sizeof(ULONG64)];
+ memset(buffer, 0, sizeof(buffer));
// Initialize symbol information retrieval structures.
DWORD64 sym_displacement = 0;
PSYMBOL_INFO symbol = reinterpret_cast<PSYMBOL_INFO>(&buffer[0]);
symbol->SizeOfStruct = sizeof(SYMBOL_INFO);
- symbol->MaxNameLen = kMaxNameLength;
+ symbol->MaxNameLen = kMaxNameLength - 1;
BOOL has_symbol = SymFromAddr(GetCurrentProcess(), frame,
&sym_displacement, symbol);