Index: third_party/tcmalloc/chromium/src/windows/addr2line-pdb.c |
diff --git a/third_party/tcmalloc/chromium/src/windows/addr2line-pdb.c b/third_party/tcmalloc/chromium/src/windows/addr2line-pdb.c |
index 7a2bf3e6f45f52d5b8533eb0ea5660d17b18be20..3d4a0c531ce41e8b24e63a9571d98ea49ce779a3 100644 |
--- a/third_party/tcmalloc/chromium/src/windows/addr2line-pdb.c |
+++ b/third_party/tcmalloc/chromium/src/windows/addr2line-pdb.c |
@@ -1,10 +1,10 @@ |
/* Copyright (c) 2008, Google Inc. |
* All rights reserved. |
- * |
+ * |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are |
* met: |
- * |
+ * |
* * Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* * Redistributions in binary form must reproduce the above |
@@ -14,7 +14,7 @@ |
* * Neither the name of Google Inc. nor the names of its |
* contributors may be used to endorse or promote products derived from |
* this software without specific prior written permission. |
- * |
+ * |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
@@ -37,11 +37,11 @@ |
#ifndef WIN32_LEAN_AND_MEAN |
#define WIN32_LEAN_AND_MEAN |
-#endif |
+#endif |
#ifndef _CRT_SECURE_NO_WARNINGS |
#define _CRT_SECURE_NO_WARNINGS |
-#endif |
+#endif |
#ifndef _CRT_SECURE_NO_DEPRECATE |
#define _CRT_SECURE_NO_DEPRECATE |
@@ -140,6 +140,7 @@ int main(int argc, char *argv[]) { |
MAX_SYM_NAME*sizeof(TCHAR) + |
sizeof(ULONG64) - 1) |
/ sizeof(ULONG64)]; |
+ memset(buffer, 0, sizeof(buffer)); |
PSYMBOL_INFO pSymbol = (PSYMBOL_INFO)buffer; |
IMAGEHLP_LINE64 line; |
DWORD dummy; |
@@ -152,7 +153,8 @@ int main(int argc, char *argv[]) { |
ULONG64 absaddr = reladdr + module_base; |
pSymbol->SizeOfStruct = sizeof(SYMBOL_INFO); |
- pSymbol->MaxNameLen = MAX_SYM_NAME; |
+ // The length of the name is not including the null-terminating character. |
+ pSymbol->MaxNameLen = MAX_SYM_NAME - 1; |
if (print_function_name) { |
if (SymFromAddr(process, (DWORD64)absaddr, NULL, pSymbol)) { |
printf("%s\n", pSymbol->Name); |