diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2022-01-28 19:25:01 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2022-01-28 19:25:01 +0300 |
commit | c66af36a28a5b50cb4f1c7fb54902c71c93122e5 (patch) | |
tree | 0841dde014340ba84c454a81193186ec33dfac6a /tests | |
parent | 85886f39bd1bff87ff805b22ed5a9c775f642a0f (diff) | |
download | bdwgc-c66af36a28a5b50cb4f1c7fb54902c71c93122e5.tar.gz |
Eliminate 'n obtained from untrusted source' code defect FP in test_cpp
* tests/test_cpp.cc (main): Do not use COVERT_DATAFLOW().
* tests/test_cpp.cc [LINT2] (main): Limit n value by 100k.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_cpp.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/test_cpp.cc b/tests/test_cpp.cc index 22630421..7f4245f0 100644 --- a/tests/test_cpp.cc +++ b/tests/test_cpp.cc @@ -317,11 +317,14 @@ void* Undisguise( GC_word i ) { GC_PTR_STORE_AND_DIRTY(xptr, x); x = 0; if (argc != 2 - || (n = (int)COVERT_DATAFLOW(atoi(argv[1]))) <= 0) { + || (n = atoi(argv[1])) <= 0) { GC_printf("usage: test_cpp number-of-iterations\n" "Assuming 10 iters\n"); n = 10; } +# ifdef LINT2 + if (n > 100 * 1000) n = 100 * 1000; +# endif for (iters = 1; iters <= n; iters++) { GC_printf( "Starting iteration %d\n", iters ); |