[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    VALGRIND_2_2_0_BRANCH: valgrind/coregrind
From:       Tom Hughes <thh () cyberscience ! com>
Date:       2004-10-28 7:56:49
Message-ID: 20041028075649.903C816C5E () office ! kde ! org
[Download RAW message or body]

CVS commit by thughes: 

When augmenting the argument vector from the VALGRIND_OPTS environment
variable and/or the .valgrindrc files, make sure that enough space is
allocated for all the old arguments, not just those that are arguments
to valgrind itself.

MERGED FROM HEAD


  M +4 -2      vg_main.c   1.198.2.3


--- valgrind/coregrind/vg_main.c  #1.198.2.2:1.198.2.3
@@ -591,5 +591,7 @@ static void augment_command_line(Int* vg
       char **from;
       char **to;
-      int env_arg_count, f1_arg_count, f2_arg_count;
+      int orig_arg_count, env_arg_count, f1_arg_count, f2_arg_count;
+
+      for ( orig_arg_count = 0; vg_argv0[orig_arg_count]; orig_arg_count++ );
       
       env_arg_count = count_args(env_clo);
@@ -603,5 +605,5 @@ static void augment_command_line(Int* vg
       /* +2: +1 for null-termination, +1 for added '--' */
       from     = vg_argv0;
-      vg_argv0 = malloc( (vg_argc0 + env_arg_count + f1_arg_count 
+      vg_argv0 = malloc( (orig_arg_count + env_arg_count + f1_arg_count 
                           + f2_arg_count + 2) * sizeof(char **));
       vg_assert(vg_argv0);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic