Browse Source

* Avoid using stack memory for argv elements to avoid corruption of help in setup_arguments

git-svn-id: trunk@17684 -
pierre 14 years ago
parent
commit
4a7a054f13
1 changed files with 12 additions and 1 deletions
  1. 12 1
      rtl/go32v2/system.pp

+ 12 - 1
rtl/go32v2/system.pp

@@ -391,9 +391,20 @@ begin
            proxy_s[13]:=#0;
            proxy_s[13]:=#0;
            proxy_s[18]:=#0;
            proxy_s[18]:=#0;
            proxy_s[23]:=#0;
            proxy_s[23]:=#0;
+           { Do not set argv[2..4] to PROXY_S
+             values, because PROXY_S is on stack,
+             while ARGV[2..4] need to be on heap.
+             PM 2011-06-08
            argv[2]:=@proxy_s[9];
            argv[2]:=@proxy_s[9];
            argv[3]:=@proxy_s[14];
            argv[3]:=@proxy_s[14];
-           argv[4]:=@proxy_s[19];
+           argv[4]:=@proxy_s[19];}
+           allocarg(2,4);
+           strcopy(argv[2], @proxy_s[9]);
+           allocarg(3,4);
+           strcopy(argv[3], @proxy_s[14]);
+           allocarg(4,4);
+           strcopy(argv[4], @proxy_s[19]);
+
            useproxy:=true;
            useproxy:=true;
            break;
            break;
          end;
          end;