aboutsummaryrefslogtreecommitdiffstats
path: root/erts/test
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2010-10-14 14:50:58 +0200
committerBjörn Gustavsson <[email protected]>2010-10-14 14:51:03 +0200
commitc7f811b03aca427fbea0cac5307b81fa19bddbc1 (patch)
tree96a2b390b50527199660a9fece17272c89ec402d /erts/test
parent0cfaafd999d74a085d6f3e212e90985700040691 (diff)
parent0983ce5264f277c9b7798758082eee1c7addb337 (diff)
downloadotp-c7f811b03aca427fbea0cac5307b81fa19bddbc1.tar.gz
otp-c7f811b03aca427fbea0cac5307b81fa19bddbc1.tar.bz2
otp-c7f811b03aca427fbea0cac5307b81fa19bddbc1.zip
Merge branch 'ms/security-fixes' into dev
* ms/security-fixes: erlc: remove unused variable typer: prevent buffer overflows run_test: prevent buffer overflow heart: prevent buffer overflow escript: prevent buffer overflows erlexec: prevent buffer overflows erlc: prevent buffer overflows dialyzer: prevent buffer overflows OTP-8892
Diffstat (limited to 'erts/test')
-rw-r--r--erts/test/erlc_SUITE.erl16
1 files changed, 14 insertions, 2 deletions
diff --git a/erts/test/erlc_SUITE.erl b/erts/test/erlc_SUITE.erl
index 437f020f99..4797f78be2 100644
--- a/erts/test/erlc_SUITE.erl
+++ b/erts/test/erlc_SUITE.erl
@@ -21,13 +21,13 @@
%% Tests the erlc command by compiling various types of files.
-export([all/1, compile_erl/1, compile_yecc/1, compile_script/1,
- compile_mib/1, good_citizen/1, deep_cwd/1]).
+ compile_mib/1, good_citizen/1, deep_cwd/1, arg_overflow/1]).
-include_lib("test_server/include/test_server.hrl").
all(suite) ->
[compile_erl, compile_yecc, compile_script, compile_mib,
- good_citizen, deep_cwd].
+ good_citizen, deep_cwd, arg_overflow].
%% Copy from erlc_SUITE_data/include/erl_test.hrl.
@@ -189,6 +189,18 @@ deep_cwd_1(PrivDir) ->
?line true = filelib:is_file("test.beam"),
ok.
+%% Test that a large number of command line switches does not
+%% overflow the argument buffer
+arg_overflow(Config) when is_list(Config) ->
+ ?line {SrcDir, _OutDir, Cmd} = get_cmd(Config),
+ ?line FileName = filename:join(SrcDir, "erl_test_ok.erl"),
+ ?line Args = lists:flatten([ ["-D", integer_to_list(N), "=1 "] ||
+ N <- lists:seq(1,10000) ]),
+ ?line run(Config, Cmd, FileName, Args,
+ ["Warning: function foo/0 is unused\$",
+ "_OK_"]),
+ ok.
+
erlc() ->
case os:find_executable("erlc") of
false ->