Ver código fonte

* properly (but silently) truncate parameters passed via environment
variables

git-svn-id: trunk@5921 -

Jonas Maebe 18 anos atrás
pai
commit
cbba170e61
1 arquivos alterados com 4 adições e 1 exclusões
  1. 4 1
      compiler/options.pas

+ 4 - 1
compiler/options.pas

@@ -1592,7 +1592,10 @@ begin
         inc(pc);
         inc(pc);
      { create argument }
      { create argument }
        arglen:=pc-argstart;
        arglen:=pc-argstart;
-       hs[0]:=chr(arglen);
+{$warning FIXME: silent truncation of environment parameters }
+       if (arglen > 255) then
+         arglen := 255;
+       setlength(hs,arglen);
        move(argstart^,hs[1],arglen);
        move(argstart^,hs[1],arglen);
        interpret_option(hs,true);
        interpret_option(hs,true);
      { skip quote }
      { skip quote }