You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2013/10/14 20:58:30 UTC

svn commit: r1532023 - /subversion/trunk/subversion/libsvn_subr/win32_crashrpt.c

Author: rhuijben
Date: Mon Oct 14 18:58:29 2013
New Revision: 1532023

URL: http://svn.apache.org/r1532023
Log:
In the Win32 crashreport handler limit the length of variable names by their
length, instead of by their 0 byte. While debugging a r1519955 related crash
I found a non zero terminated variable name here, which crashed the crash
report handler.

* subversion/libsvn_subr/win32_crashrpt.c
  (write_var_values,
   write_function_detail): Use the length of the name as limit for printf.
   We can't just copy the string here as we can't trust pools in case of a
   crash.

Modified:
    subversion/trunk/subversion/libsvn_subr/win32_crashrpt.c

Modified: subversion/trunk/subversion/libsvn_subr/win32_crashrpt.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/win32_crashrpt.c?rev=1532023&r1=1532022&r2=1532023&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/win32_crashrpt.c (original)
+++ subversion/trunk/subversion/libsvn_subr/win32_crashrpt.c Mon Oct 14 18:58:29 2013
@@ -427,13 +427,15 @@ write_var_values(PSYMBOL_INFO sym_info, 
 
       format_value(value_str, sym_info->ModBase, sym_info->TypeIndex,
                    (void *)var_data);
-      fprintf(log_file, "%s=%s", sym_info->Name, value_str);
+      fprintf(log_file, "%.*s=%s", (int)sym_info->NameLen, sym_info->Name,
+              value_str);
     }
   if (!log_params && sym_info->Flags & SYMFLAG_LOCAL)
     {
       format_value(value_str, sym_info->ModBase, sym_info->TypeIndex,
                    (void *)var_data);
-      fprintf(log_file, "        %s = %s\n", sym_info->Name, value_str);
+      fprintf(log_file, "        %.*s = %s\n", (int)sym_info->NameLen,
+              sym_info->Name, value_str);
     }
 
   return TRUE;
@@ -466,8 +468,10 @@ write_function_detail(STACKFRAME64 stack
   if (SymFromAddr_(proc, stack_frame.AddrPC.Offset, &func_disp, pIHS))
     {
       fprintf(log_file,
-                    "#%d  0x%08I64x in %.200s(",
-                    nr_of_frame, stack_frame.AddrPC.Offset, pIHS->Name);
+                    "#%d  0x%08I64x in %.*s(",
+                    nr_of_frame, stack_frame.AddrPC.Offset,
+                    pIHS->NameLen > 200 ? 200 : (int)pIHS->NameLen,
+                    pIHS->Name);
 
       /* restrict symbol enumeration to this frame only */
       ih_stack_frame.InstructionOffset = stack_frame.AddrPC.Offset;